nnn/misc/clipboard-copier/copier

24 lines
434 B
Text
Raw Normal View History

#!/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
#
# 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
2019-11-05 02:45:03 +05:30
# Wayland
# cat "$SELECTION" | xargs -0 | wl-copy