aboutsummaryrefslogtreecommitdiff
path: root/kitty/kitty-themes/.tools/previews.sh
blob: c39c2c7874d0718d4c73d23529e30c49cabf7803 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
# @author: @vrdhn on github

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}"  )" >/dev/null 2>&1 && pwd  )"
cd $SCRIPT_DIR/..

set_theme () {
    cat themes/$1.conf | awk 'BEGIN {printf("kitty @ set-colors ")} {printf( "%s=%s ",$1,$2 )} END{printf("\n")}' | sh
}

list=$(find themes -type f | grep "$1" |  xargs basename | cut -d. -f1)

for x in $list ;
do
    kitty +kitten icat "previews/$x.png"
    read -n 1 -p "$x   : Next / Set / Quit :" ans
    echo

    case $ans in
        n ) ;;
        s )  set_theme $x ; exit ;;
        q ) exit ;;
    esac
done