Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
UlyssesZh opened this issue Nov 17, 2024 · 2 comments
Open

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

UlyssesZh opened this issue Nov 17, 2024 · 2 comments

Comments

@UlyssesZh
Copy link

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.

@TomJo2000
Copy link
Member

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

@UlyssesZh
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants