aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2022-09-27 23:00:18 +0800
committerHsieh Chin Fan <pham@topo.tw>2022-09-27 23:00:18 +0800
commit74d99560d8a0dfcbf066668bce26d44a93b87ba9 (patch)
treec4338bd366e1dda39ef4fa3a04fc3806c8a45c71 /tools
parent32d48e1c1578b6498e7bcb4476b02a5f937a4fd5 (diff)
Add script for password with rofi
Diffstat (limited to 'tools')
-rwxr-xr-xtools/desktop/password-store.sh19
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
3find ~/.password-store -name '*gpg' -printf %P\\n | \
4sed 's/.gpg$//' | \
5rofi -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}