Created
March 25, 2016 18:23
-
-
Save Jzarecta/478b01d4666f4c4cef6a to your computer and use it in GitHub Desktop.
Script to sign your clipboard on the go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
######################################## | |
### signclipboard ## | |
### gpg sign your content on the go ## | |
### by: JZA ## | |
######################################## | |
# choose your desired keyid | |
keyid = '7F4C2614' | |
# Get the clipboard content | |
if ! tty -s && stdin=$(</dev/stdin) && [[ "$stdin" ]]; then | |
stdin=$stdin$'\n'$(cat) | |
qdbus org.kde.klipper /klipper setClipboardContents "$stdin" | |
exit | |
fi | |
content="qdbus org.kde.klipper /klipper getClipboardContents" | |
sign="gpg -u $keyid --clearsign -a" # choose your Keid | |
insert="qdbus org.kde.klipper /klipper setClipboardContents" | |
signedcontent=$($content|$sign) | |
$insert "$signedcontent" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment