o
odinpkg.dev
packages / app / thsw

thsw

1c986e4app

Simple application to switch desktop theme or run any command during sunset or sunrise

MIT · updated 2 years ago

thsw

Simple application to switch desktop theme:

  • from light to dark during sunset
  • from dark to light during sunrise

The only limitations is that you have to provide command that actually switches the theme in config file.

In general the thsw can execute any provided command on sunset and sunrise.

Build and run

Build the thsw with:

cargo build

Run the thsw with:

cargo run

Or alternatively you should start thsw directly:

./thsw

Example of config file is provided in config.ini You should place the config file to the location thsw give you at the first run. Normally, it is $HOME/.config/thsw/config.ini

References

It was quite difficult for find and implement algorithm that takes geo coordinates with time zone and returns the time of sunset and sunrise for current day. Many thanks to resources and authors listed below.

  1. General Solar Position Calculations, link
  2. Solar Calculation Details, link
  3. Sunrise/Sunset Algorithm, link
  4. Julian Day Number Calculator, link
  5. Jon Lund Steffensen, redshift
  6. Thomas Brüggemann, orbit