aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchell Riedstra <mitch@riedstra.dev>2021-10-25 17:55:04 -0400
committerMitchell Riedstra <mitch@riedstra.dev>2021-10-25 17:55:04 -0400
commit04154746f58048bf08368b6b71a7950ad7271cc3 (patch)
treeb2e7c8d062f1282209ecaf9be20a268e14dfc3fb
parent5a346ab4650f37b1e5d47fc8975354eb248fa3b5 (diff)
downloaddpw-04154746f58048bf08368b6b71a7950ad7271cc3.tar.gz
dpw-04154746f58048bf08368b6b71a7950ad7271cc3.tar.xz
Remove '\n' from typed/copied passwds and otps
-rwxr-xr-xdpw9
1 files changed, 7 insertions, 2 deletions
diff --git a/dpw b/dpw
index f8d0a77..4d93a9b 100755
--- a/dpw
+++ b/dpw
@@ -102,6 +102,7 @@ copy() {
pth="$1"; shift
"${DPW_BACKEND}" show "$pth" \
| sed 1q \
+ | tr -d '\n' \
| xclip -selection "$PASSWORD_STORE_X_SELECTION"
sh -c "sleep ${PASSWORD_STORE_CLIP_TIME};
@@ -112,6 +113,7 @@ _type() {
pth="$1"; shift
"${DPW_BACKEND}" show "$pth" \
| sed 1q \
+ | tr -d '\n' \
| xdotool type --delay 2ms --clearmodifiers --file -
}
@@ -194,13 +196,16 @@ case $a in
show) $OTP "$authstring" ;;
copy)
$OTP "$authstring" \
+ | tr -d '\n' \
| xclip -selection "$PASSWORD_STORE_X_SELECTION"
sh -c "sleep ${PASSWORD_STORE_CLIP_TIME};
echo '' | xclip -selection '$PASSWORD_STORE_X_SELECTION'" &
;;
- type) $OTP "$authstring" | xdotool type --delay 2ms \
- --clearmodifiers --file -
+ type)
+ $OTP "$authstring" \
+ | tr -d '\n' \
+ | xdotool type --delay 2ms --clearmodifiers --file -
;;
esac
}