dotfiles/bin/fzf-pass-inner.sh

16 lines
423 B
Bash
Raw Normal View History

2021-05-23 17:31:52 +02:00
set -euo pipefail
ENTRY=$(find ~/.password-store/ -name "*.gpg" -printf "%P\n" | sed -e 's/\.gpg$//' | fzf)
if [ -z "$ENTRY" ]; then
exit 1
fi
PASSENTRY=$(pass "$ENTRY")
2024-06-08 11:02:27 +02:00
(builtin echo "$PASSENTRY" | head -n1 | timeout 30 wl-copy -f -n --sensitive) &
2023-04-16 16:52:24 +02:00
disown -h
2021-05-23 17:31:52 +02:00
NOTIFICATION=$(builtin echo "$PASSENTRY" | sed 1d)
2024-06-03 21:37:03 +02:00
if [ ! -z "${NOTIFICATION}" ]; then
notify-send -t 6000 "$NOTIFICATION"
fi
2021-05-23 17:31:52 +02:00
builtin echo "$NOTIFICATION"