This repository has been archived on 2024-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/bin/clip
Daniel Flanagan 4cb3de339a
WIP emacs
2020-03-26 16:32:32 -05:00

14 lines
427 B
Bash
Executable file

#!/usr/bin/env sh
if is_wayland; then
# echo "Clip: YES. THIS IS WAYLAND SPEAKING." >&2
sed 's/^\s+//g' | wl-copy "$@"
echo "Your trimmed input was stored in all clipboards."
else
xclip -selection primary
xclip -selection primary -out | xclip -selection clipboard
xclip -selection primary -out | xclip -selection secondary
echo "Your input was stored in all clipboards."
sleep 5 && killall xclip > /dev/null 2>&1 &
fi