Topic: Switch light/dark theme with keybindings
I like the dark look of Crunchbang Linux, but on very sunny days the dark theme is a little bit
hard on the eyes. So I switch between a dark theme for the night and a light one for the day. I'm
aware of this "day and night theme" which switches the appearance of the screen time-controlled,
but I want to set it manually.
This is my solution:
First create a light Openbox theme file with the obconf command:
$ obconf --archive /usr/share/themes/YourLightThemeThis creates the file YourLightTheme.obt in your working directory.
Then move this file to the theme folder in your home directory:
$ mv YourLightTheme.obt ~/.themes/Repeat these steps for a dark theme!
Paste the following lines to your ~/.config/openbox/rc.xml and adjust them to your needs:
<!-- Set a light wallpaper and theme -->
<keybind key="C-S-F1">
<action name="Execute">
<startupnotify>
<enabled>true</enabled>
<name>LightWallpaper</name>
</startupnotify>
<command>nitrogen --set-centered ~/images/backgrounds/LightWallpaper.jpg</command>
</action>
</keybind>
<keybind key="C-S-F1">
<action name="Execute">
<startupnotify>
<enabled>true</enabled>
<name>LightTheme</name>
</startupnotify>
<command>obconf --install ~/.themes/YourLightTheme.obt</command>
</action>
</keybind>
<!-- Set a dark wallpaper and theme -->
<keybind key="C-S-F2">
<action name="Execute">
<startupnotify>
<enabled>true</enabled>
<name>DarkWallpaper</name>
</startupnotify>
<command>nitrogen --set-scaled ~/images/backgrounds/DarkWallpaper.png</command>
</action>
</keybind>
<keybind key="C-S-F2">
<action name="Execute">
<startupnotify>
<enabled>true</enabled>
<name>DarkTheme</name>
</startupnotify>
<command>obconf --install ~/.themes/YourDarkTheme.obt</command>
</action>
</keybind>Reconfigure Openbox: Menu -> Preferences -> Openbox Config -> Reconfigure
After that you can select the light setting with "Control + Shift + F1" and
the dark setting with "Control + Shift + F2"
Anyone know a way to change the theme.obt without the Openbox Configuration Manager popping up?
I'd appreciate that!
identi.ca/herrgruen