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

11 lines
278 B
Plaintext
Raw Normal View History

2020-01-29 15:17:18 -06:00
#!/usr/bin/env sh
2019-12-05 16:09:52 -06:00
2020-03-26 16:32:32 -05:00
if is_wayland; then
# echo "Clip: YES. THIS IS WAYLAND SPEAKING." >&2
2020-04-07 15:47:54 -05:00
sed 's/^\s+//g' | sed 's/\s+$//g' | wl-copy "$@"
2020-03-26 16:32:32 -05:00
echo "Your trimmed input was stored in all clipboards."
else
2020-04-07 15:47:54 -05:00
xclip -selection clipboard
2020-03-26 16:32:32 -05:00
sleep 5 && killall xclip > /dev/null 2>&1 &
fi