Commit 7f012fdc authored by Robert Labudda's avatar Robert Labudda
Browse files

init

parents
#!/bin/bash
#
# You can run this script to execute gpg command on the content of your clipboard.
#
CMD="$1"
clipbin=$(which xclip 2> /dev/null)
notifybin=$(which notify-send 2> /dev/null)
zenitybin=$(which zenity 2> /dev/null)
gpgbin=$(which gpg2 2> /dev/null)
if [ -z "$clipbin" ]
then
echo "Could not find the program xclip."
exit -1
fi
if [ -z "$notifybin" ]
then
echo "Could not find the program notify-send from libnotify."
exit -1
fi
if [ -z "$zenitybin" ]
then
echo "Could not find the program zenity."
exit -1
fi
if [ -z "$gpgbin" ]
then
echo "Could not find the program gpg2."
exit -1
fi
if [ -z "$CMD" ]
then
echo "No operation"
echo "Your options are: verify, sign, or decrypt"
exit -2
fi
if [ "$CMD" = "verify" ]
then
output=$($clipbin -selection clipboard -o | $gpgbin --verify 2>&1)
echo "$output" | $zenitybin --text-info --title="Signature verification" --width=800 --height=500 --font=monospace
elif [ "$CMD" = "sign" ]
then
output=$($clipbin -selection clipboard -o | $gpgbin --clear-sign)
if [ "$?" -eq 0 ]
then
echo "$output" | $clipbin -selection clipboard -i
$notifybin -i "info" "Text signed"
else
$notifybin -i "error" "Signing failed or cancelled"
fi
elif [ "$CMD" = "decrypt" ]
then
output=$($clipbin -selection clipboard -o | $gpgbin -d 2>&1)
echo "$output" | $zenitybin --text-info --title="Decrypted message" --width=800 --height=500 --font=monospace
fi
exit 0
#!/bin/bash
# Display the content of the selection as a QR code
#
# Requires xclip, qrencode, and display from ImageMagick
xclip -o | qrencode -o - | display
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment