termux-app icon indicating copy to clipboard operation
termux-app copied to clipboard

[Feature]: colors.properties separate for light and dark theme

Open UlyssesZh opened this issue 1 year ago • 3 comments

Feature description

I hope I can have two colors.properties files separately for light and dark theme depending on system settings.

Additional information

N/A.

UlyssesZh avatar Nov 17 '24 19:11 UlyssesZh

That would be possible with a small shell script to act as API glue. Along the lines of:

#!/usr/bin/env bash

# get the system theme somehow
theme="$(get_theme)" # I don't know the actual command
case "$theme" in
    'dark') cp -f "$HOME/example/dark.theme" "$HOME/.termux/colors.properties"
   'light') cp -f "$HOME/example/light.theme" "$HOME/.termux/colors.properties"
esac
termux-reload-settings

TomJo2000 avatar Nov 17 '24 22:11 TomJo2000

OK, so the problem is now what the command for getting the theme is. I guess I may have to run some Java code to use android.jar for getting that.

If the script takes some time to run, will Termux show a wrong theme before termux-reload-settings actually takes effect?

UlyssesZh avatar Nov 18 '24 17:11 UlyssesZh

https://github.com/rust-dark-light/dark-light/issues/11#issuecomment-2581599305

Rudxain avatar Jun 27 '25 01:06 Rudxain