termux-app
termux-app copied to clipboard
[Feature]: colors.properties separate for light and dark theme
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.
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
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?
https://github.com/rust-dark-light/dark-light/issues/11#issuecomment-2581599305