commit b52b7a7066e91abfca92908a8aa5c4737f94ad4a
parent 94779299f4686f0a2df79322da69a10f77f74419
Author: St John Karp <contact@stjo.hn>
Date: Mon, 30 May 2022 10:19:08 -0400
Trim newline character when copying password to clipboard
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/balrog b/balrog
@@ -121,7 +121,11 @@ while [ -n "$ACTION" ] ; do
# Decrypt and get the first line.
else
gpg2 --decrypt --quiet "$KEY_FILE" |
- ([ "$COPY" -eq 1 ] && head -n 1 | xclip -selection clipboard || cat)
+ ([ "$COPY" -eq 1 ] &&
+ head -n 1 |
+ tr -d '\n' |
+ xclip -selection clipboard ||
+ cat)
fi
# Launch a background job to clear the clipboard in 30 seconds.