diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2013-08-17 12:49:53 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2013-08-17 12:49:53 -0300 |
commit | d46f13b4683dcd456387e81b53017d2b672e778e (patch) | |
tree | 577c3950cbe1720e0a8a83002828aaeccdf0a4ac /share/keyringer | |
parent | efbf6809ec3ab4f1d34bd7bcacfaebd46e32d170 (diff) | |
download | keyringer-d46f13b4683dcd456387e81b53017d2b672e778e.tar.gz keyringer-d46f13b4683dcd456387e81b53017d2b672e778e.tar.bz2 |
Adding 'open' action
Diffstat (limited to 'share/keyringer')
-rwxr-xr-x | share/keyringer/edit | 15 | ||||
l--------- | share/keyringer/open | 1 |
2 files changed, 14 insertions, 2 deletions
diff --git a/share/keyringer/edit b/share/keyringer/edit index 0604d7e..fe05ecc 100755 --- a/share/keyringer/edit +++ b/share/keyringer/edit @@ -22,10 +22,21 @@ keyringer_set_tmpfile edit # Decrypt the information to the file $GPG --yes -o "$TMPWORK" --use-agent -d "$KEYDIR/$FILE" +if [ "$BASENAME" == "edit" ]; then + APP="$EDITOR" +elif [ "$BASENAME" == "open" ]; then + if which xdg-open &> /dev/null; then + APP="xdg-open" + else + echo "You should have xdg-open application to perform this action, aborting." + exit 1 + fi +fi + # Prompt -echo "Press any key to open the decrypted data in $EDITOR, Ctrl-C to abort" +echo "Press any key to open the decrypted data with $APP, Ctrl-C to abort" read key -$EDITOR "$TMPWORK" +$APP "$TMPWORK" # Encrypt again $GPG --yes -o "$KEYDIR/$FILE" --use-agent --armor -e -s $(keyringer_recipients "$RECIPIENTS_FILE") "$TMPWORK" diff --git a/share/keyringer/open b/share/keyringer/open new file mode 120000 index 0000000..8491ab9 --- /dev/null +++ b/share/keyringer/open @@ -0,0 +1 @@ +edit
\ No newline at end of file |