From 5f92a897b42ca2af261d8e6398e071051496bb51 Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Thu, 15 Oct 2020 23:23:21 -0400 Subject: Emojy copy script works! --- .local/bin/emoji-copy | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to '.local/bin/emoji-copy') diff --git a/.local/bin/emoji-copy b/.local/bin/emoji-copy index a52c171..9ddc05d 100755 --- a/.local/bin/emoji-copy +++ b/.local/bin/emoji-copy @@ -4,17 +4,12 @@ # to the clipboard. Some font-awesome icons are # also supported. -choice=$( cat $SCRIPTS/utilities/.emoji-list.txt | dmenu -i -p "Emojis & Font Awesome") +choice=$( cat ~/.local/share/emoji | dmenu -i -p "Font Awesome & Emojis: ") -icon=$(echo $choice | sed "s/\(.\).*$/\1/") -label=$(echo $choice | sed "s/^..\(.*\)/\1/") +icon=$(echo $choice | sed "s/^\(.\).*$/\1/") -printf $icon | xsel -b +printf "$icon" | xsel -b -echo "$icon" -if [[ "$icon" == "" ]]; then - notify-send "Operation Cancelled" -else - notify-send -i "$HOME/.fonts/svgs/$label.svg" "Clipboard:" "$label has been copied!" -fi +[ -z "$icon" ] && notify-send -a "Clipboard:" "Operation Cancelled" +[ -z "$icon" ] || notify-send -a "Clipboard:" "$icon has been copied!" -- cgit v1.2.3