aboutsummaryrefslogtreecommitdiff
path: root/.scripts/emoji
blob: 8a69ddf0de30d31ec124d5bc692b12a1bb497108 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash

window=$(xdotool getactivewindow)

set -- junk "$(cut -d '|' -f 1 ~/.config/emoji | dmenu -p emoji)"

shift

if [ $# -eq 0 ]; then
	exit
fi

emoji=$(grep "^$(echo $@)|" ~/.config/emoji | cut -d '|' -f 2 | tr -s '\r')

echo "$emoji" | clip
xdotool type --window "$window" "$emoji"

xdotool windowactivate "$window"