aboutsummaryrefslogtreecommitdiff
path: root/local/bin/insert-special-character
blob: 5b3c99e9823c8c6684fe177d28698b68b01ed45d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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