dotfiles/.local/bin/dmenuemoji
2024-04-23 07:46:41 +05:00

21 lines
556 B
Bash
Executable File

#!/bin/sh
# The get a "menu of emojis to copy" script.
# Includes:
# Emoji (1630)
chosen=$(cut -d ';' -f1 ~/.local/share/script-data/chars/e* | dmenu -i -l 30 -W 380 -X 971 -Y 15 -bw 2 | 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