summaryrefslogtreecommitdiff
path: root/scripts/dmenukaomoji
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2021-10-09 22:20:41 +0100
committerdavidovski <david@davidovski.xyz>2021-10-09 22:20:41 +0100
commit01ced0b7ce47d279789efb2dc70d1cd009ac56ad (patch)
tree6ece604b8ae3476d2d70c9c9d42f86fe607990da /scripts/dmenukaomoji
initial commit
Diffstat (limited to 'scripts/dmenukaomoji')
-rwxr-xr-xscripts/dmenukaomoji24
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/dmenukaomoji b/scripts/dmenukaomoji
new file mode 100755
index 0000000..8af99b3
--- /dev/null
+++ b/scripts/dmenukaomoji
@@ -0,0 +1,24 @@
+#!/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 Shift+Insert
+ fi
+# xdotool type --delay 1 $chosen
+
+# VAR=$(xclip -o)
+
+# xdotool type $chosen
+else
+ notify-send "'$chosen' copied to clipboard." &
+fi