aboutsummaryrefslogtreecommitdiff
path: root/extras/HOME/.local/bin/emoji-select.sh
blob: f01ed97b020850d629abe9000d7295c189176311 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash

if [[ -z "$ROFI" ]] ; then
  ROFI='rofi -dmenu'
fi

if ( which rofi ) ; then
  menu=($ROFI -i -p "Select Character" -theme-str '* {theme-color: #ffff88;}' -show run)
else
  menu=(dmenu -fn NotoSans:size=24 -i -nf "#ffff88" -sb "#ffff88" -p "Select Character" -l 12 -dim 0.4)
fi


selection="$(
  zcat $HOME/.xmonad/unicode.gz | sed 's@\([^;]\+\);\([^;]\+\).*@\1 \2 @g' |
    "${menu[@]}")"

emoji="${selection%% *}"

echo -n "$emoji" | xclip -selection clipboard