aboutsummaryrefslogtreecommitdiff
path: root/local/bin/insert-special-character
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2024-08-13 22:12:19 +0200
committerCharles Cabergs <me@cacharle.xyz>2024-08-13 22:12:19 +0200
commit47aaf2b29fa14eb683c6043b62cc11748cd073af (patch)
tree1f7b0d3e760cf56cf76feab35ebd923a8e65ee60 /local/bin/insert-special-character
parenta5a595bcfe365716bb05e68112916c2fd302fb5e (diff)
downloaddotfiles-47aaf2b29fa14eb683c6043b62cc11748cd073af.tar.gz
dotfiles-47aaf2b29fa14eb683c6043b62cc11748cd073af.tar.bz2
dotfiles-47aaf2b29fa14eb683c6043b62cc11748cd073af.zip
Add insert-special-character script to insert emojis/logo character and accented characters
Diffstat (limited to 'local/bin/insert-special-character')
-rwxr-xr-xlocal/bin/insert-special-character15
1 files changed, 15 insertions, 0 deletions
diff --git a/local/bin/insert-special-character b/local/bin/insert-special-character
new file mode 100755
index 0000000..5b3c99e
--- /dev/null
+++ b/local/bin/insert-special-character
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Copied from: https://github.com/LukeSmithxyz/voidrice/blob/628ed4dc995f3c09e33c24a01c817c18b1a268af/.local/bin/dmenuunicode#L3
+
+chosen=$(cut -d ';' -f1 ~/.local/share/insert-special-character/* | rofi -dmenu -i -l 30 | sed "s/ .*//")
+
+# Exit if none chosen.
+[ -z "$chosen" ] && exit
+
+if [ "$1" = 'copy' ]; then
+ printf "%s" "$chosen" | xclip -selection clipboard
+ notify-send "'$chosen' copied to clipboard." &
+else
+ xdotool type "$chosen"
+fi