From 47aaf2b29fa14eb683c6043b62cc11748cd073af Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Tue, 13 Aug 2024 22:12:19 +0200 Subject: Add insert-special-character script to insert emojis/logo character and accented characters --- local/bin/insert-special-character | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 local/bin/insert-special-character (limited to 'local/bin') 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 -- cgit