dot/scripts/dmenukaomoji
2025-03-17 22:54:39 +00:00

25 lines
586 B
Bash
Executable file

#!/bin/bash
chosen=$(dmenu -i -l 20 < ~/.local/share/kaomoji | sed "s/\t.*//")
[ "$chosen" != "" ] || exit
# If you run this command with an argument, it will automatically insert the character.
echo "$chosen" | xclip -selection clipboard
if [ -n "$1" ]; then
SUB="Minecraft"
WINDOW=$(xdotool getactivewindow getwindowname)
if [[ "$WINDOW" =~ .*"$SUB".* ]]; then
xdotool key "ctrl+v"
else
xdotool key "ctrl+v"
#xdotool key Shift+Insert
fi
#xdotool type --delay 1 $chosen
# VAR=$(xclip -o)
#xdotool type $chosen
else
notify-send "'$chosen' copied to clipboard." &
fi