dotfiles/Utils/emojenu

23 lines
448 B
Text
Raw Normal View History

2019-08-28 15:59:12 +00:00
#!/bin/bash
window=$(xdotool getactivewindow)
pushd "$(dirname "$0")"
#set -- junk $(cat kaomoji | cut -d '|' -f 1 | dmenu -p emoji)
set -- junk $(cat kaomoji | rofi -dmenu -i | cut -d'|' -f1)
shift
if [ $# -eq 0 ]; then
exit
fi
emoji=$(cat kaomoji | grep "^$(echo $@)|" | cut -d '|' -f 2 | tr -s '\r')
#echo "$emoji" | xclip -selection clipboard
xdotool windowactivate $window
echo -n "$emoji" | xclip -sel clip
xdotool type "$emoji"