use xdotool type
This commit is contained in:
parent
833d5fe9b7
commit
50baa1a44f
1 changed files with 7 additions and 7 deletions
|
@ -2,16 +2,16 @@
|
||||||
|
|
||||||
# The famous "get a menu of emojis to copy" script.
|
# The famous "get a menu of emojis to copy" script.
|
||||||
|
|
||||||
# Must have xclip installed to even show menu.
|
# Get user selection via dmenu from emoji file.
|
||||||
xclip -h 2>/dev/null || exit 1
|
chosen=$(cut -d ';' -f1 ~/.local/share/larbs/emoji | dmenu -i -l 30 | sed "s/ .*//")
|
||||||
|
|
||||||
chosen=$(cut -d ';' -f1 ${XDG_DATA_HOME:-$HOME/.local/share}/larbs/emoji | dmenu -i -l 20 | sed "s/ .*//")
|
# Exit if none chosen.
|
||||||
|
[ -z "$chosen" ] && exit
|
||||||
|
|
||||||
[ "$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 you run this command with an argument, it will automatically insert the character.
|
|
||||||
if [ -n "$1" ]; then
|
if [ -n "$1" ]; then
|
||||||
xdotool key Shift+Insert
|
xdotool type "$chosen"
|
||||||
else
|
else
|
||||||
echo "$chosen" | tr -d '\n' | xclip -selection clipboard
|
echo "$chosen" | tr -d '\n' | xclip -selection clipboard
|
||||||
notify-send "'$chosen' copied to clipboard." &
|
notify-send "'$chosen' copied to clipboard." &
|
||||||
|
|
Loading…
Reference in a new issue