2020-02-08 23:43:37 +00:00
|
|
|
#!/bin/sh
|
2019-11-23 19:26:35 +00:00
|
|
|
|
|
|
|
# The famous "get a menu of emojis to copy" script.
|
2018-10-29 19:01:24 +00:00
|
|
|
|
2018-11-04 21:16:37 +00:00
|
|
|
# Must have xclip installed to even show menu.
|
2020-02-09 14:15:58 +00:00
|
|
|
xclip -h 2>/dev/null || exit 1
|
2018-10-29 19:01:24 +00:00
|
|
|
|
2020-04-04 19:55:06 +00:00
|
|
|
chosen=$(cut -d ';' -f1 $XDG_DATA_HOME/larbs/emoji | dmenu -i -l 20 | sed "s/ .*//")
|
2018-11-04 21:16:37 +00:00
|
|
|
|
|
|
|
[ "$chosen" != "" ] || exit
|
|
|
|
|
2020-02-09 14:17:43 +00:00
|
|
|
# If you run this command with an argument, it will automatically insert the character.
|
2020-02-09 14:15:58 +00:00
|
|
|
if [ -n "$1" ]; then
|
|
|
|
xdotool key Shift+Insert
|
|
|
|
else
|
|
|
|
echo "$chosen" | tr -d '\n' | xclip -selection clipboard
|
|
|
|
notify-send "'$chosen' copied to clipboard." &
|
|
|
|
fi
|