dotfiles/scripts/get-pass-comments.sh

18 lines
535 B
Bash
Raw Normal View History

2019-07-11 16:09:05 +02:00
#!/bin/sh
site="$(find "$PASSWORD_STORE_DIR" -name "*.gpg" -type f | \
sed "s|^$PASSWORD_STORE_DIR/||" | sed "s|\\.gpg$||" | \
rofi -dmenu -p "Entry")"
[ -z "$site" ] && exit 0
comments="$(pass show "$site" | sed '1d')"
num="$(echo "$comments" | grep -n "comments:" | sed '1q;d' | \
awk '{print $1}' | sed -r 's|([^:]*):.*|\1|')"
[ "$num" -ne 1 ] && comments="$(echo "$comments" | sed "1,$(( $num - 1 ))d")"
notify-send "This terminal will close in 45 seconds"
st -e $SCRIPTS/eval.sh "echo \"$comments\" && sleep 45"