added option to type password directly in textbox

This commit is contained in:
Phuntsok Drak-pa
2019-11-04 10:57:55 +01:00
parent 740f579d61
commit 275e2c6c58
2 changed files with 70 additions and 4 deletions

View File

@@ -1,5 +1,19 @@
#!/usr/bin/env fish
for arg in $argv
switch $arg
case '--type'
set -g TYPE "yes"
case '-t'
set -g TYPE "yes"
case 'type'
set -g TYPE "yes"
case '*'
printf 'Unknown argument: %s\n.' $arg
exit 1
end
end
set passwords (find $HOME/.password-store -type f -name "*.gpg" | \
string replace -r ".*.password-store/" "" | \
string replace -r ".gpg" "" | sort)
@@ -12,4 +26,10 @@ if test -z $password
exit
end
pass show -c $password 2> /dev/null
if test $TYPE = "yes"
set -l IFS
set pass (pass show $password | string split -n \n)[1]
printf %s $pass | xvkbd -file -
else
pass show -c $password 2> /dev/null
end