
Using Thunar's built-in "custom actions" editor, I've written a small script and then added custom actions for Thunar.
1) The bash-script
This small wrapper script is necessary, because the filename manipulation (e.g. remove '.gpg' file suffix when decrypting) was not possible by the shell thunar's custom actions are executed in.
Code: Select all
#!/bin/bash
FILE_IN="$2"
DIR="$3"
case "$1" in
encrypt)
echo "not implemented, yet."
;;
decrypt)
FILE_OUT="$DIR/$(basename $FILE_IN .gpg)"
echo "Decrypting '$FILE_IN' to '$FILE_OUT'..."
cmd="gpg --output '$FILE_OUT' --decrypt '$FILE_IN'"
eval $cmd
;;
*)
echo ""
echo "SYNTAX: $0 (encrypt|decrypt) <filename> <dirname>"
echo ""
echo "<filename>: Use %n"
echo "<dirname>: Use %d"
echo ""
sleep 5
;;
esac

2) Decrypt:
Add the following custom action in Thunar:
Code: Select all
xterm -iconic -e /usr/bin/thunar-gpg decrypt %n %d