this post was submitted on 15 Oct 2023
2 points (100.0% liked)
snippets
46 readers
1 users here now
guides, scripts, small programs, etc.
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
It's two tools:
c
andv
for copy and paste respectively.Say you want to copy an output of a command, say
grep -i 'abc' file.txt | sed 's/b/d/'
then you can easily add
| c
to the end to get:grep -i 'abc' file.txt | sed 's/b/d/' | c
and this will copy to clipboard, specifically for KDE's clipboard manager, Klipper. If you wanted to see the help text for more ways to copy, you'd run
c
on its ownThe benefit is the tool won't break between x11 and wayland, but the downsides are that it's tied to klipper, and you cant see more clipboard metadata, like mimetypes
If you only use wayland, i'd recommend using wl-clipboard, and
alias c=wl-copy
andalias v=wl-paste
it's a better tool, imo.Should you still want to use my lil snippet, you will need to create these files yourself, i suggest either in your
$HOME/.local/bin/
or/usr/local/bin/
. And don't forget tochmod +x
them so they are executable.Happy experimenting :)
Thank you so much! You are so kind!
Aw thanks! I'm glad I was able to help :)