blob: a1a091d58590bc3e3d4fbd86433303e08a7401fb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#! /bin/bash
ENTRIES="$(find ~/.password-store -name '*gpg' -printf %P\\n | sed 's/.gpg$//')"
# Give rofi available passwords and exit
if [ $# -eq 0 ]; then
# Specify rofi prompt as 'Edit'
echo -e "\0prompt\x1fEdit"
echo "$ENTRIES"
exit 0
fi
# If password doesn't exist, just quit
<<<"$ENTRIES" grep -q $1 || exit 0
# Use detected terminal emulator to edit password
coproc (
terminal=${terminal:-alacritty}
EDITOR=vim $terminal -e pass edit $1 && $(dirname $0)/pass.get $1
)
|