From b302bd659fb974513909e394edabec007f3c46d4 Mon Sep 17 00:00:00 2001 From: Yorick van Pelt Date: Mon, 3 Jun 2024 21:37:03 +0200 Subject: [PATCH] attempt to fix ala-fzf --- bin/ala-fzf-pass.sh | 1 + bin/fzf-pass-inner.sh | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/ala-fzf-pass.sh b/bin/ala-fzf-pass.sh index f6c5e7f..728ede7 100755 --- a/bin/ala-fzf-pass.sh +++ b/bin/ala-fzf-pass.sh @@ -1,3 +1,4 @@ set -euo pipefail +alacritty msg create-window --class ala-fzf -e "$HOME/dotfiles/bin/fzf-pass-inner.sh" && exit 0 exec alacritty --class ala-fzf -e "$HOME/dotfiles/bin/fzf-pass-inner.sh" diff --git a/bin/fzf-pass-inner.sh b/bin/fzf-pass-inner.sh index 3b86466..63513da 100755 --- a/bin/fzf-pass-inner.sh +++ b/bin/fzf-pass-inner.sh @@ -5,12 +5,14 @@ if [ -z "$ENTRY" ]; then exit 1 fi PASSENTRY=$(pass "$ENTRY") -builtin echo "$PASSENTRY" | head -n1 | nohup wl-copy -f -n --sensitive & +(builtin echo "$PASSENTRY" | head -n1 | nohup wl-copy -f -n --sensitive) & 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" +if [ ! -z "${NOTIFICATION}" ]; then + notify-send -t 6000 "$NOTIFICATION" +fi builtin echo "$NOTIFICATION"