keyring no longer copies plaintext passwords to cliphist database, can now escape from cliphist window back to the toolbelt menu

This commit is contained in:
pagedmov
2024-10-31 18:20:09 -04:00
parent 07b19b2cdb
commit c6d381fc58
2 changed files with 15 additions and 2 deletions

View File

@@ -12,6 +12,7 @@ cliphistory() {
else \ else \
cliphist decode \"\$index\" | fmt -w 30; \ cliphist decode \"\$index\" | fmt -w 30; \
fi" --prompt="> " | awk '{print $1}') fi" --prompt="> " | awk '{print $1}')
[ -z "$selection" ] && return 1
cliphist decode "$selection" | wl-copy cliphist decode "$selection" | wl-copy
} }
btop_cmd() { btop_cmd() {

View File

@@ -15,8 +15,20 @@ pkgs.writeShellScriptBin "keyring" ''
[ $? = 0 ] || { [ -f /tmp/keyringfile ] && /run/current-system/sw/bin/rm /tmp/keyringfile; exit 1; } [ $? = 0 ] || { [ -f /tmp/keyringfile ] && /run/current-system/sw/bin/rm /tmp/keyringfile; exit 1; }
# pass it through fmt for soft word wrapping # prevents cliphist from writing passwords to the clipboard history
pass -c "$pass_string" | fmt -w 45 pkill -STOP wl-paste
# copy password
pass -c "$pass_string" > /dev/null
echo "Password copied. Clearing clipboard in 10 seconds."
# start a timer for 10 seconds, clear clipboard, resume cliphist tracking
nohup bash <<- EOF &
sleep 10
wl-copy -c
pkill -CONT wl-paste
EOF
/run/current-system/sw/bin/rm /tmp/keyringfile /run/current-system/sw/bin/rm /tmp/keyringfile
sleep 0.5 sleep 0.5
exit 0 exit 0