forked from arp242/uni
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dmenu-uni
executable file
·36 lines (30 loc) · 1.36 KB
/
dmenu-uni
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
# https://github.com/arp242/uni
#
# Usage:
#
# dmenu-uni all All codepoints, won't include ZWJ emoji sequences.
# dmenu-uni emoji All emojis.
# dmenu-uni emoji-common Common emojis
#
# NOTE: dmenu will *crash* when using a colour emoji font, this is a bug in Xft:
# https://bugs.freedesktop.org/show_bug.cgi?id=107534
dmenu="dmenu -i" # Command to use
#dmenu="dmenu -x -i -l 20 -fn monospace:size=20" # Adding some options
#dmenu="rofi -dmenu" # Use Rofi instead
#dmenu="fzf" # Use fzf instead
# Command to copy to clipboard:
copy="xclip -rmlastnl -selection clipboard"
# Common emojis I use >99% of the time:
common="-or g:smileys g:hand-fingers-open g:hand-fingers-partial g:hand-single-finger g:hand-fingers-closed g:hands g:body-parts g:person-gesture"
# Display onlt the male variants:
#common="$common -gender male"
# Set skin tone:
#common="$common -tone mediumdark"
case "${1:-all}" in
all) uni -c p all | $dmenu | grep -o "^'.'" | tr -d "'" | $copy ;;
emoji) uni -c e all | $dmenu | cut -d ' ' -f1 | $copy ;;
emoji-common) uni -c e $common | $dmenu | cut -d ' ' -f1 | $copy ;;
*) uni -c e $@ | $dmenu | cut -d ' ' -f1 | $copy ;;
#*) echo >&2 "dmenu-uni: unknown '$1'" ;;
esac