Skip to content

Instantly share code, notes, and snippets.

@pgaskin
Last active December 30, 2020 08:36
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pgaskin/c653301df616362c46cfdf2f046ce6ef to your computer and use it in GitHub Desktop.
Save pgaskin/c653301df616362c46cfdf2f046ce6ef to your computer and use it in GitHub Desktop.
Apply color schemes to the termux app from the command line.
#!/bin/sh
function jsonValue() {
KEY=$1
num=$2
awk -F"[,:}]" '{for(i=1;i<=NF;i++){if($i~/'$KEY'\042/){print $(i+1)}}}' | tr -d '"' | sed -n ${num}p
}
if [ $# -eq 0 ]; then
echo Usage: $0 theme-name
echo
echo Themes:
curl -k -s "https://api.github.com/repos/termux/termux-styling/contents/app/src/main/assets/colors"|jsonValue name|sed 's/.properties//g'|sed 's/ //g'
else
cd ~
mkdir -p .termux
curl -k -s "https://raw.githubusercontent.com/termux/termux-styling/master/app/src/main/assets/colors/$1.properties" > ~/.termux/colors.properties
termux-reload-settings
fi
Copy link

ghost commented Jan 15, 2018

Syntax error: "(" unexpected

Copy link

ghost commented Apr 16, 2018

Not working

@muzicstation
Copy link

working! thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment