2019-01-04 22:33:55 +05:30
|
|
|
#!/usr/bin/env sh
|
2017-10-10 20:29:48 +05:30
|
|
|
|
2019-01-05 10:57:11 +05:30
|
|
|
# Description: Copy selection to clipboard
|
|
|
|
#
|
2019-03-24 21:11:43 +05:30
|
|
|
# Shell: POSIX compliant
|
2019-01-05 10:57:11 +05:30
|
|
|
# Author: Arun Prakash Jana
|
|
|
|
|
2019-06-20 19:10:47 +05:30
|
|
|
SELECTION=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection
|
2019-04-21 23:59:51 +05:30
|
|
|
|
2018-12-01 21:42:51 +05:30
|
|
|
# Linux
|
2019-04-21 23:59:51 +05:30
|
|
|
cat "$SELECTION" | xargs -0 | xsel -bi
|
2018-12-01 21:42:51 +05:30
|
|
|
|
|
|
|
# macOS
|
2019-04-21 23:59:51 +05:30
|
|
|
# cat "$SELECTION" | xargs -0 | pbcopy
|
2018-11-30 06:19:19 +05:30
|
|
|
|
|
|
|
# Termux
|
2019-04-21 23:59:51 +05:30
|
|
|
# cat "$SELECTION" | xargs -0 | termux-clipboard-set
|
2018-12-01 21:42:51 +05:30
|
|
|
|
|
|
|
# Cygwin
|
2019-04-21 23:59:51 +05:30
|
|
|
# cat "$SELECTION" | xargs -0 | clip
|