2019-11-03 11:44:04 +00:00
|
|
|
#!/usr/bin/env fish
|
|
|
|
|
2019-11-04 09:57:55 +00:00
|
|
|
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
|
|
|
|
|
2019-11-03 11:44:04 +00:00
|
|
|
set passwords (find $HOME/.password-store -type f -name "*.gpg" | \
|
|
|
|
string replace -r ".*.password-store/" "" | \
|
|
|
|
string replace -r ".gpg" "" | sort)
|
|
|
|
|
|
|
|
set password (for elem in $passwords
|
|
|
|
echo $elem
|
|
|
|
end | rofi -dmenu -i -p "Select your password")
|
|
|
|
|
|
|
|
if test -z $password
|
|
|
|
exit
|
|
|
|
end
|
|
|
|
|
2019-11-04 09:57:55 +00:00
|
|
|
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
|