nnn/misc/clipboard-copier/copier

21 lines
383 B
Plaintext
Raw Normal View History

#!/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
#
# 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