fixed notification if no emoji is selected

This commit is contained in:
Phuntsok Drak-pa 2019-10-23 13:01:43 +02:00
parent a5f2331f69
commit 6b98792d32
2 changed files with 2 additions and 0 deletions

View File

@ -123,6 +123,7 @@
Also, lets send a notification telling the user the emoji has been copied! Also, lets send a notification telling the user the emoji has been copied!
#+BEGIN_SRC fish #+BEGIN_SRC fish
set emoji (xclip -o -selection clipboard | tr -d '\n') set emoji (xclip -o -selection clipboard | tr -d '\n')
test -z "$emoji" && notify-send "No emoji copied" && exit
set -a emoji "copied to clipboard" set -a emoji "copied to clipboard"
pgrep -x dunst >/dev/null && notify-send $emoji pgrep -x dunst >/dev/null && notify-send $emoji
#+END_SRC #+END_SRC

View File

@ -2,5 +2,6 @@
grep -v "#" ~/.config/emoji.txt | rofi -dmenu -i | awk '{print $1}' | tr -d '\n' | xclip -selection clipboard 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') set emoji (xclip -o -selection clipboard | tr -d '\n')
test -z "$emoji" && exit
set -a emoji "copied to clipboard" set -a emoji "copied to clipboard"
pgrep -x dunst >/dev/null && notify-send $emoji pgrep -x dunst >/dev/null && notify-send $emoji