1
0
Fork 0

bin: Rewrite xsel-swap in bash

This commit is contained in:
Jeremy Kaplan 2019-12-14 15:18:43 -08:00
commit 9f4c4ca738

View file

@ -1,5 +1,5 @@
#!/usr/bin/env tako #!/usr/bin/env bash
tmp = ?(xsel) # primary -> tmp tmp="$(xsel)" # primary -> tmp (stripping any trailing newlines)
xsel -b | xsel -i # clipboard -> primary xsel -b | xsel -i # clipboard -> primary
echo -n @(tmp) | xsel -bi # tmp -> clipboard printf '%s' "$tmp" | xsel -bi # tmp -> clipboard (without adding a newline)