Last active
March 28, 2025 23:50
-
-
Save tombh/5d96587dabebff7e59d801a845acbf92 to your computer and use it in GitHub Desktop.
A homemade emoji picker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Dependencies: `uni`, `wl-copy`, `kitty`, `wtype`, `fzf` | |
# `uni` project: https://github.com/source-foundry/uni | |
# Usage: `chmod a+x emoji.bash`, then run the script whenever you to pick emojis | |
export EMOJI_CHAR_PATH="/tmp/unicode_result-$USER.txt" | |
touch "$EMOJI_CHAR_PATH" | |
function _unicode_search { | |
local type=$1 | |
local char | |
local args | |
args=( | |
-format '%(emoji l:auto) %(name)' | |
-compact | |
emoji all | |
) | |
char=$(uni "${args[@]}" | fzf | cut -d' ' -f1) | |
echo -n "$char" >"$EMOJI_CHAR_PATH" | |
echo -n "$char" | |
} | |
function unicode_search { | |
local type=$1 | |
local char && char=$(_unicode_search "$type") | |
echo "$char" | wl-copy --trim-newline | |
echo "Copied $char to clipboard" | |
} | |
function emoji_picker { | |
kitty \ | |
--title "Emoji Picker" \ | |
-o "remember_window_size=no" \ | |
-o "initial_window_width=45c" \ | |
-o "initial_window_height=15c" \ | |
-o "font_size=20" \ | |
bash -c \ | |
"./emoji.bash _unicode_search" | |
wtype "$(cat "$EMOJI_CHAR_PATH")" | |
} | |
subcommand=${1:-emoji_picker} | |
"$subcommand" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Forked this gist
Here provided
uni
package url is wrong.My fork allows use on both Wayland or X11.