I am a user of Linux Mint. One feature I often wish I had in Linux is the ability to switch between light and dark modes depending on the time of the day, as in macOS and mobile devices.
I have put together the following script for switching from light to dark mode:
#!/bin/bash
notify-send "Switching to dark mode"
gsettings set org.cinnamon.desktop.wm.preferences theme Mint-Y-Dark
gsettings set org.cinnamon.desktop.interface gtk-theme Mint-Y-Dark
gsettings set org.cinnamon.theme name Mint-Y-Dark
and I have another one for the opposite direction
#!/bin/bash
gsettings set org.cinnamon.desktop.wm.preferences theme Mint-Y
gsettings set org.cinnamon.desktop.interface gtk-theme Mint-Y
gsettings set org.cinnamon.theme name Mint-Y
Currently, I run these manually when I want to switch between the two themes.
Most programs respect the OS-wide theme meaning this method works surprisingly well! However, there are three problems that I would like to solve with this approach:
- Automated switching between light/dark modes depending on the time of day (as in macOS). I tried using
cronandanacronbut they don't work well for this purpose. When my computer is turned on after a period of being off, I would like it to realise that the time to switch has passed and perform the mode switch (as in macOS and various mobile devices); - I would like my terminal (GNOME Terminal, Cinnamon default) to switch from a light theme to a dark theme (and vice versa); and
- I would like my text editor (Emacs) to load a light/dark theme.
Even getting just (1) to work would be quite nice!