Skip to content

A bash script to auto-switch to darkmode at sunset and back at sunrise for Ubuntu 22.04 and 24.04, using systemd and no internet connection.

License

Notifications You must be signed in to change notification settings

littleant/auto-darkmode-switcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

What does this script do?

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.

Installation

  1. Open the auto-darkmode-switcher.sh script with a text-editor and add your latitude, longitude and preferred themes.
  2. Execute the install script once: sh ./install.sh.
  3. If it complains about dependencies, install them and execute it again.

Troubleshooting

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.

How to stop the script

Execute systemctl --user stop auto-darkmode-switcher.timer.

Follow the install-instructions if you want to start it again.

About

A bash script to auto-switch to darkmode at sunset and back at sunrise for Ubuntu 22.04 and 24.04, using systemd and no internet connection.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages