Script to try various themes from kitty terminal

2019-12-16 197 words 1 min read

Here is the script. Very simple yet very useful script.

#!/bin/bash - 
#===============================================================================
#
#          FILE: kitty-theme.sh
# 
#         USAGE: ./kitty-theme.sh 
# 
#   DESCRIPTION: 
# 
#       OPTIONS: ---
#  REQUIREMENTS: ---
#          BUGS: ---
#         NOTES: ---
#        AUTHOR: Amit Agarwal (aka),
#  ORGANIZATION: Individual
#       CREATED: 12/06/2019 10:15
# Last modified: Fri Dec 06, 2019  10:41AM
#      REVISION:  ---
#===============================================================================

set -o nounset                              # Treat unset variables as an error

FOLDER="/git/terminal.sexy/dist/schemes"  ### This is git folder where you have terminal.sexy cloned

if [[ ! -d $FOLDER ]]
then
    cd $FOLDER/../../../
    git clone https://github.com/stayradiated/terminal.sexy

fi

cd $FOLDER
tmp=$(mktemp /tmp/color-XXXXXXXX)
echo $tmp
files=$(find . -type f -name \*json)
for line in $(echo ${files[*]})
do
    echo "Processing $line"
    >$tmp
    echo "# From $line.. processed by Amit Agarwal script" >> $tmp
    sed -n -e '/color/,/\],/ p' $line | sed -e 1d -e '$d'| \
        sed 's/[",]//g'|awk '{count++; print "color"count"\t "$1}' >> $tmp
    grep ground $line |sed 's/^ *//' |sed 's/[":,]//g' >> $tmp

    kitty @ set-colors -a $tmp

    ls --color=auto ~
    read -p "If you like the theme, just press l ::" test
    if [[ $test == "l" ]]
    then
        rm -f ~/.config/kitty/theme.conf
        cp $tmp ~/.config/kitty/theme.conf
    fi
done
rm -f $tmp

author

Authored By Amit Agarwal

Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it