You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I would like to switch from solarized light to solarized dark depending on if on Gnome it is dark theme enabled or not.
Describe the solution you'd like
Automatic switch theme from dark to light based on Gnome theme, or atleast when it is starting it should be mindful of the Gnome dark theme settings
Additional
Please give CLI option to set theme, so that I can atleast automate through a bash function
The text was updated successfully, but these errors were encountered:
The first problem is that there is no mapping of [Light <-> Dark] themes. There are a couple of themes that only have one variant. So btop doesn't know (and probably shouldn't care) if you're theme is dark or light. The other thing is that this would tie a CLI application to a desktop, and I'm not sure if this is good idea.
Please give CLI option to set theme, so that I can atleast automate through a bash function
This seems reasonable.
As a workaround, this wrapper script edits the config based on the theme type you provide it.
You still need to talk to gnome and parse it's mode and pass either dark or light to the script.
#!/usr/bin/env python3importosimportsubprocessimportsysfrompathlibimportPath# Mode is the first command line argument# As an alternative, set mode based on gnome's theme type heremode=sys.argv[1]
# Path to btop's config file in the user's homeconfig= (
Path(os.path.expanduser("~"))
.joinpath(".config")
.joinpath("btop")
.joinpath("btop.conf")
)
# Read the config, replacing the `color_theme` statement based on the `mode`withconfig.open() asfile:
lines= [
lineif"color_theme"notinlineelsef'color_theme = "solarized_{mode}"\n'forlineinfile
]
# Write the new configwithconfig.open("w") asfile:
forlineinlines:
file.write(line)
# Launch btopsubprocess.run(["btop"], check=False)
Is your feature request related to a problem? Please describe.
I would like to switch from solarized light to solarized dark depending on if on Gnome it is dark theme enabled or not.
Describe the solution you'd like
Automatic switch theme from dark to light based on Gnome theme, or atleast when it is starting it should be mindful of the Gnome dark theme settings
Additional
Please give CLI option to set theme, so that I can atleast automate through a bash function
The text was updated successfully, but these errors were encountered: