Add dmenu

This commit is contained in:
Mike Wilson
2025-06-18 13:25:39 -04:00
parent 54d74a083e
commit 48f3910ad7
4 changed files with 1659 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
#!/bin/sh
# Get user selection via dmenu from emoji file.
chosen=$(cut -d ';' -f1 ~/.local/share/chars/emoji | dmenu -l 30 | sed "s/ .*//")
# Exit if none chosen.
[ -z "$chosen" ] && exit
# If you run this command with an argument, it will automatically insert the
# character. Otherwise, show a message that the emoji has been copied.
if [ -n "$1" ]; then
xdotool type "$chosen"
else
printf "%s" "$chosen" | xclip -selection clipboard
notify-send "'$chosen' copied to clipboard." &
fi