diff options
Diffstat (limited to 'X11/rofi')
-rwxr-xr-x | X11/rofi/pass.get | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/X11/rofi/pass.get b/X11/rofi/pass.get index 80dc0cc..9aaf542 100755 --- a/X11/rofi/pass.get +++ b/X11/rofi/pass.get | |||
@@ -28,14 +28,15 @@ if [ $# -eq 0 ]; then | |||
28 | # Specify rofi prompt as 'Get' | 28 | # Specify rofi prompt as 'Get' |
29 | echo -e "\0prompt\x1fGet" | 29 | echo -e "\0prompt\x1fGet" |
30 | 30 | ||
31 | find ~/.password-store -name '*gpg' -printf %P\\n | \ | 31 | find $HOME/.password-store -name '*gpg' -printf %P\\n | \ |
32 | sed 's/.gpg$//' | 32 | sed 's/.gpg$//' |
33 | 33 | ||
34 | exit 0 | 34 | exit 0 |
35 | fi | 35 | fi |
36 | 36 | ||
37 | # Test password exists or not | 37 | # Test password exists or not |
38 | RESULT="$(pass $1)" | 38 | RESULT="$(pass $1)" |
39 | set -x | ||
39 | if [ -n "$RESULT" ]; then | 40 | if [ -n "$RESULT" ]; then |
40 | # Copy the given password into PRIMARY selection and kill it in 30s | 41 | # Copy the given password into PRIMARY selection and kill it in 30s |
41 | echo "$RESULT" | sed -n 1p | tr -d '\n' | xsel -i -t 30000 | 42 | echo "$RESULT" | sed -n 1p | tr -d '\n' | xsel -i -t 30000 |
@@ -46,12 +47,11 @@ if [ -n "$RESULT" ]; then | |||
46 | EXTRA="$(echo; echo; echo "$RESULT" | sed '1d' | sed '1{/^$/d}')" | 47 | EXTRA="$(echo; echo; echo "$RESULT" | sed '1d' | sed '1{/^$/d}')" |
47 | coproc ( rofi -e "Copied: $1$EXTRA" ) | 48 | coproc ( rofi -e "Copied: $1$EXTRA" ) |
48 | 49 | ||
49 | # Password doesn't exist yet | 50 | elif [ -f "$HOME/.password-store/$1.gpg" ]; then |
50 | # Go to next rofi execution | 51 | coproc ( rofi -e "GPG passphase is not chached" ) |
51 | elif pass find $1 &>/dev/null; then | ||
52 | echo -e "\0prompt\x1fGPG Issue" | ||
53 | echo Passphase is not chached | ||
54 | else | 52 | else |
53 | # Password doesn't exist yet | ||
54 | # Go to next rofi execution | ||
55 | echo -e "\0prompt\x1f$1" | 55 | echo -e "\0prompt\x1f$1" |
56 | echo -e "\0message\x1fThis password doesn't exist, generate with custom arguments?" | 56 | echo -e "\0message\x1fThis password doesn't exist, generate with custom arguments?" |
57 | echo -e "\0data\x1f$1" | 57 | echo -e "\0data\x1f$1" |