fzf-pass: kill after 30s

master
Yorick van Pelt 2023-04-16 16:52:24 +02:00
parent 43b19c3935
commit 3851e23343
Signed by: yorick
GPG Key ID: A36E70F9DC014A15
1 changed files with 5 additions and 3 deletions

View File

@ -5,9 +5,11 @@ if [ -z "$ENTRY" ]; then
exit 1
fi
PASSENTRY=$(pass "$ENTRY")
# todo: kill after 30s
builtin echo "$PASSENTRY" | head -n1 | nohup wl-copy -f &
disown
builtin echo "$PASSENTRY" | head -n1 | nohup wl-copy -f -n &
WLCOPY_PID=$!
disown -h
nohup bash -c "sleep 30s; kill $WLCOPY_PID" &
disown -h
NOTIFICATION=$(builtin echo "$PASSENTRY" | sed 1d)
notify-send -t 6000 "$NOTIFICATION"