dunicode no primary and insert emoji if arg

This commit is contained in:
Luke Smith 2020-02-09 09:15:58 -05:00
parent 971e769f0b
commit dc92b9db4c
No known key found for this signature in database
GPG key ID: 4C50B54A911F6252

View file

@ -3,16 +3,15 @@
# The famous "get a menu of emojis to copy" script. # The famous "get a menu of emojis to copy" script.
# Must have xclip installed to even show menu. # Must have xclip installed to even show menu.
xclip -h >/dev/null || exit xclip -h 2>/dev/null || exit 1
chosen=$(grep -v "#" ~/.local/share/larbs/emoji | dmenu -i -l 20 -fn Monospace-18) chosen=$(cut -d ';' -f1 ~/.local/share/larbs/emoji | dmenu -i -l 20 | sed "s/ .*//")
[ "$chosen" != "" ] || exit [ "$chosen" != "" ] || exit
c=$(echo "$chosen" | sed "s/ .*//") if [ -n "$1" ]; then
echo "$c" | tr -d '\n' | xclip -selection clipboard xdotool key Shift+Insert
notify-send "'$c' copied to clipboard." & else
echo "$chosen" | tr -d '\n' | xclip -selection clipboard
s=$(echo "$chosen" | sed "s/.*; //" | awk '{print $1}') notify-send "'$chosen' copied to clipboard." &
echo "$s" | tr -d '\n' | xclip fi
notify-send "'$s' copied to primary." &