Skip to content

Commit

Permalink
Shows active style
Browse files Browse the repository at this point in the history
  • Loading branch information
adi1090x committed Jan 5, 2021
1 parent c433a43 commit 0c0145c
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions tstyle
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ apply_colors () {
scheme=${color_schemes[(( answer - 1 ))]}
echo " ${BLUE}[${RED}*${BLUE}] ${ORANGE}Applying Color Scheme..."
cp $COLORS_DIR/$scheme $TERMUX_DIR/colors.properties
if [[ ! -f "$TERMUX_DIR/.current_color" ]]; then
touch "$TERMUX_DIR/.current_color"
echo "$scheme" > "$TERMUX_DIR/.current_color"
else
echo "$scheme" > "$TERMUX_DIR/.current_color"
fi
{ reload_settings; reset_color; exit; }
else
echo -n " ${BLUE}[${RED}!${BLUE}] ${RED}Invalid Option, Try Again."
Expand Down Expand Up @@ -124,6 +130,12 @@ apply_fonts () {
font_ttf=${fonts_list[(( answer - 1 ))]}
echo " ${BLUE}[${RED}*${BLUE}] ${ORANGE}Applying Fonts..."
cp $FONTS_DIR/$font_ttf $TERMUX_DIR/font.ttf
if [[ ! -f "$TERMUX_DIR/.current_font" ]]; then
touch "$TERMUX_DIR/.current_font"
echo "$font_ttf" > "$TERMUX_DIR/.current_font"
else
echo "$font_ttf" > "$TERMUX_DIR/.current_font"
fi
{ reload_settings; reset_color; exit; }
else
echo -n " ${BLUE}[${RED}!${BLUE}] ${RED}Invalid Option, Try Again."
Expand All @@ -137,6 +149,12 @@ random_style () {
echo " ${BLUE}[${RED}*${BLUE}] ${ORANGE}Setting Random Style..."
random_scheme=$(ls $COLORS_DIR | shuf -n 1)
{ cp $COLORS_DIR/$random_scheme $TERMUX_DIR/colors.properties; }
if [[ ! -f "$TERMUX_DIR/.current_color" ]]; then
touch "$TERMUX_DIR/.current_color"
echo "$random_scheme" > "$TERMUX_DIR/.current_color"
else
echo "$random_scheme" > "$TERMUX_DIR/.current_color"
fi
{ reload_settings; reset_color; exit; }
}

Expand Down Expand Up @@ -189,10 +207,12 @@ about_program () {

## Main menu
until [[ "$REPLY" =~ ^[q/Q]$ ]]; do
active_color=`cat $TERMUX_DIR/.current_color`
active_font=`cat $TERMUX_DIR/.current_font`
banner
echo "
${BLUE}[${RED}C${BLUE}] ${GREEN}Colors ($total_colors)
${BLUE}[${RED}F${BLUE}] ${GREEN}Fonts ($total_fonts)
${BLUE}[${RED}C${BLUE}] ${GREEN}Colors ($total_colors) (${CYAN}${active_color%.*}${GREEN})
${BLUE}[${RED}F${BLUE}] ${GREEN}Fonts ($total_fonts) (${CYAN}${active_font%.*}${GREEN})
${BLUE}[${RED}R${BLUE}] ${GREEN}Random
${BLUE}[${RED}I${BLUE}] ${GREEN}Import
${BLUE}[${RED}A${BLUE}] ${GREEN}About
Expand Down

0 comments on commit 0c0145c

Please sign in to comment.