Automatically Switch To Light / Dark Themes Based On Sunrise And Sunset Times With AutomaThemely

If you're looking for an easy way of automatically changing your desktop theme based on sunrise and sunset times, give AutomaThemely a try.

AutomaThemely Settings

AutomaThemely is a Python application that automatically changes Gnome themes according to light and dark hours, useful if you want to use a dark Gtk theme at night and a light Gtk theme during the day.

Besides automatically changing the Gtk3 theme, AutomaThemely can also automatically switch between dark and light themes for Atom editor and VSCode, as well as between light and dark syntax highlighting for Atom editor. This is obviously also done based the time of day.

AutomaThemely Atom VSCode
AutomaThemely Atom and VSCode theme / syntax settings

The application uses your IP address to determine your location in order to retrieve the sunrise and sunset times, and requires a working Internet connection for this. However, you can disable automatic location from the application user interface, and enter your location manually.

From the AutomaThemely user interface you can also enter a time offset (in minutes) for the sunrise and sunset times, and enable or disable notifications on theme changes.

Update: The application initially only supported changing Gtk themes on Gnome (or Unity), but with the new 1.3 release, it adds support for KDE Plasma, Xfce and Cinnamon, as well as changing the Gnome Shell and icon theme.

The latest AutomaThemely also includes a revamped settings manager, and support for custom scripts that can be triggered on sunrise and sunset.


Downloading / installing AutomaThemely



Ubuntu 18.04: using the link above, download the Python 3.6 DEB which includes dependencies (python3.6-automathemely_1.2_all.deb).

Ubuntu 16.04: you'll need to download and install the AutomaThemely Python 3.5 DEB which DOES NOT include dependencies (python3.5-no_deps-automathemely_1.2_all.deb), and install the dependencies (requests, astral, pytz, tzlocal and schedule) separately, using PIP3:

sudo apt install python3-pip
python3 -m pip install --user requests astral pytz tzlocal schedule

The AutomaThemely download page also includes RPM packages for Python 3.5 or 3.6, with and without dependencies. Install the package appropriate for your Python version. If you download the package that includes dependencies and they are not available on your system, grab the "no_deps" package and install the Python3 dependencies using PIP3, as explained above.

Using AutomaThemely to change to light / dark Gtk themes based on Sun times


To set AutomaThemely to change your theme according to light and dark hours, set the desired light and dark themes, then right click the application icon and select "Update sun times", followed by another right click, this time selecting "Restart the sqcheduler".

If your desktop environment doesn't support these right click actions, you can perform these operations by using these commands:

automathemely --update
automathemely --restart

5 comments:

  1. Be careful installing this software. I can't get it off my system, even with using a force uninstall command. Avoid.

    ReplyDelete
    Replies
    1. How did you install it, from what package? Also, what Linux distribution are you using and what exactly was the error? I can't help with so little info.

      Did you just mean the warnings like this: "dpkg: warning: while removing automathemely, directory '/usr/local/lib/python3.6/dist-packages' not empty so not removed"? That's a warning and yes, that means the DEB (if you used a deb to install) is packaged poorly, but it doesn't mean the package was not removed. From AskUbuntu: "The message is common when the folder is not empty, as the message suggests. This is because other packages also put their files in this folder." That is... if this is the issue you were talking about.

      Delete
    2. I see you posted the bug on GitHub: https://github.com/C2N14/AutomaThemely/issues/3. I'm not the developer of this tool but I'll try to help there.

      Delete
  2. Hey there! I am the author of this software. Just leaving this comment here to let Logix and/or whoever reads this know that I've just released a new version which supports more desktop environments other than GNOME, such as KDE Plasma, XFCE and Cinnamon, and hopefully more to come!

    Also, I thanks for the article I really appreciate it :)

    ReplyDelete
    Replies
    1. Thanks for the information, I'll add a note about the update in the article.

      Delete