aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2023-03-18 10:52:41 -0300
committerSilvio Rhatto <rhatto@riseup.net>2023-03-18 10:52:41 -0300
commit409a111fca74bf2712e29ca5811b19d431efb54a (patch)
tree7d90c22987e2b35f49dee9529d87e05c4db0fba7 /lib
parent0ccb3e0511f492eb5fb5dfb9729489c6fb9fa0ab (diff)
parent29f9851345cddee59baec92ac62822bb9f540b38 (diff)
downloadkeyringer-upstream.tar.gz
keyringer-upstream.tar.bz2
New upstream version 0.5.9upstream_keyringer_0.5.9upstream
Diffstat (limited to 'lib')
-rwxr-xr-xlib/keyringer/actions/edit6
-rwxr-xr-xlib/keyringer/actions/xclip6
2 files changed, 9 insertions, 3 deletions
diff --git a/lib/keyringer/actions/edit b/lib/keyringer/actions/edit
index a480eea..ae4f4b0 100755
--- a/lib/keyringer/actions/edit
+++ b/lib/keyringer/actions/edit
@@ -24,6 +24,12 @@ keyringer_set_tmpfile $BASENAME.$EXTENSION
# Decrypt the information to the file
$GPG --yes -o "$TMPWORK" --use-agent -d "$KEYDIR/$FILE"
+# Check whether decryption suceeded
+if [ "$?" != "0" ]; then
+ echo "Error decrypting $FILE, aborting"
+ exit 1
+fi
+
# Action check
if [ "$BASENAME" == "edit" ]; then
APP="$EDITOR"
diff --git a/lib/keyringer/actions/xclip b/lib/keyringer/actions/xclip
index 0e36dae..ff82cc1 100755
--- a/lib/keyringer/actions/xclip
+++ b/lib/keyringer/actions/xclip
@@ -16,14 +16,14 @@ clip() {
#local xclip="xclip -selection clipboard"
local xclip="xclip"
- before="$($xclip -o | base64)"
+ before="$($xclip -o 2> /dev/null | base64)"
# Avoid "Error: target STRING not available"
# https://github.com/astrand/xclip/issues/38
echo "$RANDOM" | $xclip &> /dev/null
# Copy text into clipboard
- echo -n "$1" | $xclip
+ echo -n "$1" | $xclip &> /dev/null
# Cleanup procedure
(
@@ -42,7 +42,7 @@ clip() {
# so we axe it here:
qdbus org.kde.klipper /klipper org.kde.klipper.klipper.clearClipboardHistory &>/dev/null
- echo "$before" | base64 -d | $xclip
+ echo "$before" | base64 -d | $xclip 2> /dev/null
) & disown
echo "Copied $2 to clipboard. Will clear in 45 seconds."
}