summaryrefslogtreecommitdiff
path: root/.local/bin/emoji-copy
blob: a52c17180cd0a6290c8b08df0c2129f099231fa5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

# Runs a prompt to choose an emoji to copy
# to the clipboard. Some font-awesome icons are
# also supported.

choice=$( cat $SCRIPTS/utilities/.emoji-list.txt | dmenu -i -p "Emojis & Font Awesome")

icon=$(echo $choice | sed "s/\(.\).*$/\1/")
label=$(echo $choice | sed "s/^..\(.*\)/\1/")

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