pekwm daytime
Most (desktop) environments these days have support for both a light and dark mode and during the winter semester the changes in ambient lighting is quite dramatic during the day and so this is something I’ve been wanting to have in pekwm not having to do it manually.
During the summer semester, there’s virtually no need for me as it is mostly bright outside during the hours I’m awake.
Anyway, pekwm has gotten a new optional component, pekwm_sys that is
configured in the new Sys
section of the main config file.
Example:
Sys {
Enable = "True"
LocationLookup = "True"
NetTheme = "Raleigh"
XResources {
Day {
"XTerm*background" = "#ffffff"
"XTerm*foreground" = "#000000"
}
Night {
"XTerm*background" = "#000000"
"XTerm*foreground" = "#ffffff"
}
}
}
It is currently able to:
- Lookup location based on IP using geoip.pw (requires libcurl)
- Calculate sun-set and sun-rise times based on location.
- XSETTINGS provider, used for GTK theme switching.
- Set XResources on time of day changes.
- Execute abritary commands on time of day changes.
Demo
This shows how the new functionality changes pekwm, xterm and GTK on the fly when time of day is changed: