This is an automatic theme switcher for Ubuntu 22.04 and 24.04.
It sets the light-theme at sunrise and automatically switches to the dark-theme at sunset. It also sets the prefer-light/prefer-dark value to indicate to programs and websites which version you prefer.
- Open the
auto-darkmode-switcher.sh
script with a text-editor and add your latitude, longitude and preferred themes. - Execute the install script once:
sh ./install.sh
. - If it complains about dependencies, install them and execute it again.
Execute systemctl --user list-timers
. If all went well, there should be a "auto-darkmode-switcher.time"-unit in the list. Exit by pressing Q.
Execute systemctl --user stop auto-darkmode-switcher.timer
.
Follow the install-instructions if you want to start it again.