From b692210193226d5aeed6eb688f5c3da30ec1bd96 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 8 May 2022 11:03:41 -0300 Subject: Fix(xclip): avoid 'Error: target STRING not available' --- lib/keyringer/actions/xclip | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/keyringer/actions') diff --git a/lib/keyringer/actions/xclip b/lib/keyringer/actions/xclip index da86315..f63fdb5 100755 --- a/lib/keyringer/actions/xclip +++ b/lib/keyringer/actions/xclip @@ -4,8 +4,11 @@ # # Copy contents to clipboard. +# # Function thanks to Password Store by Jason A. Donenfeld # distributed under GPLv2+: http://www.zx2c4.com/projects/password-store/ +# +# Adapted by rhatto clip() { # This base64 business is a disgusting hack to deal with newline inconsistancies # in shell. There must be a better way to deal with this, but because I'm a dolt, @@ -14,7 +17,15 @@ clip() { #local xclip="xclip -selection clipboard" local xclip="xclip" before="$($xclip -o | base64)" + + # Avoid "Error: target STRING not available" + # https://github.com/astrand/xclip/issues/38 + echo "$RANDOM" | $xclip + + # Copy text into clipboard echo -n "$1" | $xclip + + # Cleanup procedure ( sleep 45 now="$($xclip -o | base64)" -- cgit v1.2.3 From cdf70d5e37aac6d697d3014e8f41ca173b586031 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Mon, 6 Jun 2022 11:14:44 -0300 Subject: Fix: encrypt: BASEPATH evaluation when encrypting a folder --- lib/keyringer/actions/encrypt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/keyringer/actions') diff --git a/lib/keyringer/actions/encrypt b/lib/keyringer/actions/encrypt index 1256374..f762f29 100755 --- a/lib/keyringer/actions/encrypt +++ b/lib/keyringer/actions/encrypt @@ -93,7 +93,7 @@ fi # Encrypt if [ "$UNENCRYPTED_FILE" != "-" ] && [ -d "$UNENCRYPTED_FILE" ]; then # Time to go recursive - BASEPATH="`basename $FILE .asc`" + BASEPATH="`echo $FILE | sed -e 's/.asc$//'`" FILEPATH="`dirname "$UNENCRYPTED_FILE"`" if [ "$FILEPATH" == "." ]; then -- cgit v1.2.3