Quickly find Emoji for your clipboard
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
809 B

#!/usr/bin/env bash
# Prompt the user to select an Emoji
selection=$(rofi -dmenu -i -matching glob -width 800 -columns 4 -p "Emoji" < /usr/share/rofmoji/emoji-list)
# If a selection was made
if [ -n "$selection" ]; then
# Retreive the Emoji from the selection string
emoji=$(echo "$selection" | cut -d ':' -f 1 | tr -d '\n')
# If wl-clipboard is installed
# copy with `wl-copy`
if command -v wl-copy $>/dev/null; then
wl-copy $emoji
notify-send "Rofmoji" "${emoji} Copied!"
exit 0
fi
# If xclip is installed
# copy with `xclip`
if command -v xclip $>/dev/null; then
echo $emoji | xclip
notify-send "Rofmoji" "${emoji} Copied!"
exit 0
fi
# If failed to copy, output Emoji to Stdout
printf ${emoji}
fi
exit 0