aboutsummaryrefslogtreecommitdiffhomepage
path: root/X11/rofi/pass.edit
diff options
context:
space:
mode:
Diffstat (limited to 'X11/rofi/pass.edit')
-rwxr-xr-xX11/rofi/pass.edit22
1 files changed, 22 insertions, 0 deletions
diff --git a/X11/rofi/pass.edit b/X11/rofi/pass.edit
new file mode 100755
index 0000000..fb6ade9
--- /dev/null
+++ b/X11/rofi/pass.edit
@@ -0,0 +1,22 @@
1#! /bin/sh
2
3ROFI_ARGS=( '-font' 'Hack 22' )
4ENTRIES="$(find ~/.password-store -name '*gpg' -printf %P\\n | sed 's/.gpg$//')"
5
6# Give rofi available passwords and exit
7if [ $# -eq 0 ]; then
8 # Specify rofi prompt as 'Edit'
9 echo -e "\0prompt\x1fEdit"
10
11 echo "$ENTRIES"
12 exit 0
13fi
14
15# If password doesn't exist, just quit
16<<<"$ENTRIES" grep -q $1 || exit 0
17
18# Use alacritty to edit password
19coproc (
20 alacritty -e pass edit $1 && pass $1 --clip
21 rofi "${ROFI_ARGS[@]}" -e "Copied: $1"
22)