1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2025-03-18 18:07:45 +01:00
dotfiles/.local/bin/tools/unicode_menu

25 lines
739 B
Plaintext
Raw Normal View History

2019-09-07 17:42:18 +02:00
#!/bin/sh
2020-04-02 00:06:34 +02:00
2019-09-07 17:42:18 +02:00
# Give dmenu list of all unicode characters to copy.
# Shows the selected character in dunst if running.
2020-04-02 00:06:34 +02:00
# by lukesmithxyz, checkout github.com/lukesmithxyz/voidrice
2019-09-07 17:42:18 +02:00
# Must have xclip installed to even show menu.
2023-08-14 02:34:23 +02:00
xclip -h > /dev/null 2>&1 || exit
2019-09-07 17:42:18 +02:00
if [ -e ~/.config/fontawesome ]; then
2020-03-27 10:50:29 +01:00
chosen=$(grep -v "#" -h ~/.config/emoji ~/.config/fontawesome | dmenu -i -l 20 )
2019-09-07 17:42:18 +02:00
else
2020-03-27 15:07:19 +01:00
chosen=$(grep -v "#" ~/.config/emoji | dmenu -i -l 20 )
2019-09-07 17:42:18 +02:00
fi
[ "$chosen" != "" ] || exit
c=$(echo "$chosen" | sed "s/ .*//")
echo "$c" | tr -d '\n' | xclip -selection clipboard
notify-send "'$c' copied to clipboard." &
s=$(echo "$chosen" | sed "s/.*; //" | awk '{print $1}')
echo "$s" | tr -d '\n' | xclip
notify-send "'$s' copied to primary." &