Blame


1 e5bee144 2022-05-09 op # clip
2 e5bee144 2022-05-09 op
3 e5bee144 2022-05-09 op clip is a small utility to manage the X clipboard sensibly. It's
4 e5bee144 2022-05-09 op meant to be used interactively, not in scripts.
5 e5bee144 2022-05-09 op
6 e5bee144 2022-05-09 op if the standard input is not a tty, slurp everything (except the last
7 e5bee144 2022-05-09 op newline!) to the clipboard
8 e5bee144 2022-05-09 op
9 e5bee144 2022-05-09 op if [ ! -t 0 ]; then
10 e5bee144 2022-05-09 op exec xclip -r -selection clipboard >/dev/null
11 e5bee144 2022-05-09 op fi
12 e5bee144 2022-05-09 op
13 e5bee144 2022-05-09 op otherwise output its contents
14 e5bee144 2022-05-09 op
15 e5bee144 2022-05-09 op exec xclip -o -selection clipboard