nnn/misc/clipboard-copier/copier
2019-11-21 00:31:39 +05:30

24 lines
414 B
Bash
Executable file

#!/usr/bin/env sh
# Description: Copy selection to clipboard
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana
SELECTION=${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection
# Linux
xargs -0 < "$SELECTION" | xsel -bi
# macOS
# xargs -0 < "$SELECTION" | pbcopy
# Termux
# xargs -0 < "$SELECTION" | termux-clipboard-set
# Cygwin
# xargs -0 < "$SELECTION" | clip
# Wayland
# xargs -0 < "$SELECTION" | wl-copy