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
 

$ cat /usr/local/bin/c

#!/bin/sh
if test -n "$1"; then
	STDIN="${1}"
elif test ! -t 0; then
	STDIN=$(cat)
else
	echo 'Usage:'
	echo '	c < /path/to/file'
	echo '	c text-to-be-copied'
	echo '	command | c'
	exit 1
fi

qdbus org.kde.klipper /klipper setClipboardContents "$STDIN"

$ cat /usr/local/bin/v

#!/bin/sh
qdbus org.kde.klipper /klipper getClipboardContents

This is what I like to use :)

you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 2 points 10 months ago (1 children)

Thank you so much! You are so kind!

[โ€“] [email protected] 2 points 10 months ago

Aw thanks! I'm glad I was able to help :)