diff options
author | Arun Prakash Jana <engineerarun@gmail.com> | 2020-04-24 10:12:24 +0530 |
---|---|---|
committer | Arun Prakash Jana <engineerarun@gmail.com> | 2020-04-24 18:12:18 +0530 |
commit | bc572df55a35cc738466996abe26339fc5acaeda (patch) | |
tree | 3798d449e971b9265a79a901ccc8b7ca37dd5f8d /plugins/.cbcp | |
parent | 752bc67de03d158ece3f0fb43f6f2a3e6b2011b9 (diff) | |
download | nnn-bc572df55a35cc738466996abe26339fc5acaeda.tar.gz |
NNN_SEL: custom selection file
Diffstat (limited to 'plugins/.cbcp')
-rwxr-xr-x | plugins/.cbcp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/.cbcp b/plugins/.cbcp index 022e88a..8830e90 100755 --- a/plugins/.cbcp +++ b/plugins/.cbcp @@ -19,27 +19,27 @@ IFS="$(printf '%b_' '\n')"; IFS="${IFS%_}" # protect trailing \n -SELECTION=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection +selection=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection} if which xsel >/dev/null 2>&1; then # Linux - tr '\0' '\n' < "$SELECTION" | xsel -bi + tr '\0' '\n' < "$selection" | xsel -bi elif which xclip >/dev/null 2>&1; then # Linux - tr '\0' '\n' < "$SELECTION" | xclip -sel clip + tr '\0' '\n' < "$selection" | xclip -sel clip elif which pbcopy >/dev/null 2>&1; then # macOS - tr '\0' '\n' < "$SELECTION" | pbcopy + tr '\0' '\n' < "$selection" | pbcopy elif which termux-clipboard-set >/dev/null 2>&1; then # Termux - tr '\0' '\n' < "$SELECTION" | termux-clipboard-set + tr '\0' '\n' < "$selection" | termux-clipboard-set elif which clip.exe >/dev/null 2>&1; then # WSL - tr '\0' '\n' < "$SELECTION" | clip.exe + tr '\0' '\n' < "$selection" | clip.exe elif which clip >/dev/null 2>&1; then # Cygwin - tr '\0' '\n' < "$SELECTION" | clip + tr '\0' '\n' < "$selection" | clip elif which wl-copy >/dev/null 2>&1; then # Wayland - tr '\0' '\n' < "$SELECTION" | wl-copy + tr '\0' '\n' < "$selection" | wl-copy fi |