diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2024-08-13 22:12:19 +0200 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2024-08-13 22:12:19 +0200 |
| commit | 47aaf2b29fa14eb683c6043b62cc11748cd073af (patch) | |
| tree | 1f7b0d3e760cf56cf76feab35ebd923a8e65ee60 /local/bin | |
| parent | a5a595bcfe365716bb05e68112916c2fd302fb5e (diff) | |
| download | dotfiles-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')
| -rwxr-xr-x | local/bin/insert-special-character | 15 |
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 |
