diff options
author | justsaumit <justsaumit@draconyan.xyz> | 2022-02-27 07:00:19 +0530 |
---|---|---|
committer | justsaumit <justsaumit@draconyan.xyz> | 2022-02-27 07:00:19 +0530 |
commit | b7c8da835bb251862a3b2b23458bd2f4c5f58f5f (patch) | |
tree | 5b934e387371202fb2bf9fb689b254bacfe354ac /scripts/emojiselw | |
parent | 7eb981e3ac9742ed1fefe49e7ef058f783e63f76 (diff) |
Pushing old local updates
Diffstat (limited to 'scripts/emojiselw')
-rwxr-xr-x | scripts/emojiselw | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/emojiselw b/scripts/emojiselw new file mode 100755 index 0000000..9e6f055 --- /dev/null +++ b/scripts/emojiselw @@ -0,0 +1,19 @@ +#!/bin/sh + +# The famous "get a menu of emojis to copy" script. + +# Get user selection via dmenu from emoji file. +windowsid=$(xdotool getactivewindow) +chosen=$(cut -d ';' -f1 ~/.local/share/emoji | dmenu -i -l 30 -w $windowsid | 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 "$chosen" | xclip -sel c + notify-send "'$chosen' copied to clipboard." & +fi + |