aboutsummaryrefslogtreecommitdiff
path: root/env/.local/bin/system/kaomoji-picker.sh
blob: a59e3c73d8acdff7d57c59c4ee46546781eede0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

# set up to work with https://github.com/Aptivi-Analytics/KaomojiList.git

KAO_FILE="$HOME/stuff/manual-programs/KaomojiList/kaomojis.json"

choices=$(jq '.[]|.categories|.[]|.name' "$KAO_FILE" | sed 's/"//g')

choice=$(echo "$choices" | sed /^$/d | rofi -dmenu "$prompt_message")

emojlist=$(jq -r --arg sel "$choice" '..| select(.name==$sel)? | .emoticons | .[]' "$KAO_FILE")

emoj=$(echo "$emojlist" | sed /^$/d | rofi -dmenu "$prompt_message")

if [ "$WAYLAND_DISPLAY" ]; then
    printf -- "$emoj" | wl-copy
else
    printf -- "$emoj" | xclip -sel clip
fi