diff options
| author | Hsieh Chin Fan <pham@topo.tw> | 2022-09-27 23:00:18 +0800 |
|---|---|---|
| committer | Hsieh Chin Fan <pham@topo.tw> | 2022-09-27 23:00:18 +0800 |
| commit | 74d99560d8a0dfcbf066668bce26d44a93b87ba9 (patch) | |
| tree | c4338bd366e1dda39ef4fa3a04fc3806c8a45c71 /tools | |
| parent | 32d48e1c1578b6498e7bcb4476b02a5f937a4fd5 (diff) | |
Add script for password with rofi
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/desktop/password-store.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/desktop/password-store.sh b/tools/desktop/password-store.sh new file mode 100755 index 0000000..e83529b --- /dev/null +++ b/tools/desktop/password-store.sh | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | #! /bin/bash | ||
| 2 | |||
| 3 | find ~/.password-store -name '*gpg' -printf %P\\n | \ | ||
| 4 | sed 's/.gpg$//' | \ | ||
| 5 | rofi -dmenu -font 'Hack 22' | { | ||
| 6 | read ARG1 ARG2 | ||
| 7 | if [[ $ARG1 =~ gen ]]; then | ||
| 8 | # Generate a new password by ARG2 | ||
| 9 | alacritty --hold -e pass generate $ARG2 | ||
| 10 | else | ||
| 11 | pass $ARG1 | { | ||
| 12 | read PASSWORD | ||
| 13 | echo $PASSWORD | xsel -ib | ||
| 14 | |||
| 15 | rofi -e "Password Copied: $ARG1 $(echo; echo; cat | sed '1{/^$/d}')" \ | ||
| 16 | -font 'Hack 22' | ||
| 17 | } | ||
| 18 | fi | ||
| 19 | } | ||