~emersion/dotfiles

dotfiles/bin/emoji-menu -rwxr-xr-x 486 bytes
e1d51497Simon Ser bin/release: fix "tea release" command 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh -eu

default_cache_home=~/.cache
cache_home="${XDG_CACHE_HOME:-$default_cache_home}"
mkdir -p "$cache_home"
data_file="$cache_home/emoji-menu.json"

if ! [ -f "$data_file" ]; then
	curl -o "$data_file" -L "https://github.com/github/gemoji/raw/master/db/emoji.json"
fi

filter='.[] | (.emoji + " " + .description + " (" + (.aliases | join(", ")) + ")")'
sel="$(jq -r "$filter" <"$data_file" | menu | cut -d ' ' -f 1 | tr -d '\n')"
if [ -n "$sel" ]; then
	wl-ime-type "$sel"
fi