nnn/misc/clipboard-copier/copier

21 lines
359 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-04-21 18:29:51 +00:00
SELECTION=~/.config/nnn/.selection
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