aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2022-06-27 09:06:38 -0300
committerSilvio Rhatto <rhatto@riseup.net>2022-06-27 09:06:38 -0300
commit605e747eee231ebb364aa84a3a54cb3e362e5efa (patch)
tree2ffdaa6f6adf795c5e4657093adb9c6ddf3a571c /lib
parent2469b3245e2f59d1f1719ec4e3becb2b384b7488 (diff)
parent23bc11277cbb1e2f9a06ab357ac20106c9965b90 (diff)
downloadkeyringer-605e747eee231ebb364aa84a3a54cb3e362e5efa.tar.gz
keyringer-605e747eee231ebb364aa84a3a54cb3e362e5efa.tar.bz2
New upstream version 0.5.7upstream_keyringer_0.5.7
Diffstat (limited to 'lib')
-rwxr-xr-xlib/keyringer/actions/encrypt2
-rwxr-xr-xlib/keyringer/actions/xclip11
2 files changed, 12 insertions, 1 deletions
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
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 <Jason@zx2c4.com>
# 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)"