2019-01-04 17:03:55 +00:00
|
|
|
#!/usr/bin/env sh
|
2017-10-10 14:59:48 +00:00
|
|
|
|
2019-01-05 05:27:11 +00:00
|
|
|
# Description: Copy selection to clipboard
|
|
|
|
#
|
2019-03-24 15:41:43 +00:00
|
|
|
# Shell: POSIX compliant
|
2019-01-05 05:27:11 +00:00
|
|
|
# Author: Arun Prakash Jana
|
|
|
|
|
2019-06-20 13:40:47 +00:00
|
|
|
SELECTION=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection
|
2019-04-21 18:29:51 +00:00
|
|
|
|
2018-12-01 16:12:51 +00:00
|
|
|
# Linux
|
2019-04-21 18:29:51 +00:00
|
|
|
cat "$SELECTION" | xargs -0 | xsel -bi
|
2018-12-01 16:12:51 +00:00
|
|
|
|
|
|
|
# macOS
|
2019-04-21 18:29:51 +00:00
|
|
|
# cat "$SELECTION" | xargs -0 | pbcopy
|
2018-11-30 00:49:19 +00:00
|
|
|
|
|
|
|
# Termux
|
2019-04-21 18:29:51 +00:00
|
|
|
# cat "$SELECTION" | xargs -0 | termux-clipboard-set
|
2018-12-01 16:12:51 +00:00
|
|
|
|
|
|
|
# Cygwin
|
2019-04-21 18:29:51 +00:00
|
|
|
# cat "$SELECTION" | xargs -0 | clip
|
2019-11-04 21:15:03 +00:00
|
|
|
|
|
|
|
# Wayland
|
|
|
|
# cat "$SELECTION" | xargs -0 | wl-copy
|