From 6b98792d32d55906233dc4b725a2bd7b67ec64cb Mon Sep 17 00:00:00 2001 From: Phuntsok Drak-pa Date: Wed, 23 Oct 2019 13:01:43 +0200 Subject: [PATCH] fixed notification if no emoji is selected --- .local/bin/README.org | 1 + .local/bin/rofi-emoji | 1 + 2 files changed, 2 insertions(+) diff --git a/.local/bin/README.org b/.local/bin/README.org index fde6a78..2c375d6 100644 --- a/.local/bin/README.org +++ b/.local/bin/README.org @@ -123,6 +123,7 @@ Also, let’s send a notification telling the user the emoji has been copied! #+BEGIN_SRC fish set emoji (xclip -o -selection clipboard | tr -d '\n') + test -z "$emoji" && notify-send "No emoji copied" && exit set -a emoji "copied to clipboard" pgrep -x dunst >/dev/null && notify-send $emoji #+END_SRC diff --git a/.local/bin/rofi-emoji b/.local/bin/rofi-emoji index 453c7f5..de5067f 100755 --- a/.local/bin/rofi-emoji +++ b/.local/bin/rofi-emoji @@ -2,5 +2,6 @@ grep -v "#" ~/.config/emoji.txt | rofi -dmenu -i | awk '{print $1}' | tr -d '\n' | xclip -selection clipboard set emoji (xclip -o -selection clipboard | tr -d '\n') +test -z "$emoji" && exit set -a emoji "copied to clipboard" pgrep -x dunst >/dev/null && notify-send $emoji