forked from geraldwuhoo/passrofi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
passrofi
executable file
·23 lines (19 loc) · 846 Bytes
/
passrofi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#This is a script to use pass with rofi.
#This is the original script https://github.com/geraldwuhoo/passrofi/blob/master/passrofi
#Mine has a chance just to use a differend theme for rofi. Nothing more.
#!/bin/sh
export prefix=${PASSWORD_STORE_DIR-~/.password-store}
account="$(find "$prefix" -type f -name '*.gpg' -print0 | \
xargs -I '{}' -0 sh -c 'f="{}"; f="${f#"$prefix"/}"; echo "${f%.gpg}"' | \
rofi -dmenu -theme $HOME/.config/rofi/second_theme/dmenu_edited.rasi -i -l 10 -p "Accounts:" -kb-custom-1 "Ctrl+i" -kb-custom-2 "Ctrl+o")"
retv=$?
if [ $retv -eq 10 ]
then
pass show "$account" 2> /dev/null | grep -e "^login:" | cut -d' ' -f2 | xclip -sel clip
echo "Copied $account username to clipboard."
elif [ $retv -eq 11 ]
then
pass otp -c "$account" 2> /dev/null
else
pass show -c "$account" 2> /dev/null
fi