aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/emoji-menu.sh
diff options
context:
space:
mode:
authorJustine Smithies <justine@smithies.me.uk>2026-01-24 17:24:58 +0000
committerJustine Smithies <justine@smithies.me.uk>2026-01-24 17:24:58 +0000
commit1d6a548bcbe85ee95e986c475b23733c2977bf04 (patch)
tree7605c43bf5b4f4044a606c6b404ab9d71cd55ddc /.local/bin/emoji-menu.sh
parent818cb6579e422a03da5564ef93715f43f969954c (diff)
Initial commit
Diffstat (limited to '.local/bin/emoji-menu.sh')
-rwxr-xr-x.local/bin/emoji-menu.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/.local/bin/emoji-menu.sh b/.local/bin/emoji-menu.sh
new file mode 100755
index 0000000..ec6711b
--- /dev/null
+++ b/.local/bin/emoji-menu.sh
@@ -0,0 +1,18 @@
+#!/bin/sh -eu
+# From: https://git.sr.ht/~emersion/dotfiles/tree/6575f89856d012c2c31e9e7d2c807f350c7503d4/item/bin/emoji-menu
+# This version uses `fuzzel` instead of `rofi`.
+
+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" | fuzzel --no-exit-on-keyboard-focus-loss -d | cut -d ' ' -f 1 | tr -d '\n')"
+if [ -n "$sel" ]; then
+ wl-copy "$sel"
+fi