script.sh (415B)
1 #!/bin/bash 2 3 set -e 4 5 case "$1" in 6 "list") 7 data=$(sed '0,/^__DATA__$/d' "$0") 8 echo "$data" 9 ;; 10 "copy") 11 input=$(tee) 12 if [ ! -z "$input" ]; then 13 emoji=${input: -1} 14 echo -n "$emoji" | xclip -selection c 15 command -v notify-send > /dev/null && notify-send -t 200 "$emoji copied!" 16 fi 17 ;; 18 "") 19 bash $0 list | dmenu -p 'Emoji: ' | bash $0 copy 20 ;; 21 esac 22 23 exit 24 25 __DATA__