Automatic Dark Theme

Could it be possible to add a new theme choosing between dark and light depending on the system’s theme on macOS Mojave and later ?

For instance light theme is better at day but dark theme is better for reading at night. macOS Catalina already has a feature that changes the theme depending on the time of the day. Is it possible for Mailspring to adapt it’s with Catalina’s ?


(Originally posted by lsonnino on GitHub.)

(Original post had 7 upvotes.)

The Problem
Currently you have to manually switch between Light theme and Dark theme.

Proposed Solution
Changing the theme automatically can be done in many different ways. I think the best approach will be the user choosing a time period for when a particular theme to be chosen. For example, from 7 AM to 7 PM, Mailspring will be using a Light theme, and from 7 PM to 7 AM, Mailspring will be using a Dark theme.

Alternative Solutions
Another way will be to look at the system theme and deciding based on that. For example, on Windows, Mailspring can check a Registry value called “AppsUseLightTheme” located at “HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize” And if it’s set on 0, that means Windows is using Dark Mode, and if it’s set to 1, that means Windows is using Light mode.

1 Like

Electron has a nice guide on how to integrate with the OS level theme to detect light/dark modes: Dark Mode | Electron

1 Like

Hi, are there any updates on whether this is planned to be implemented? Thanks

please i specifically installed this for the theme

It would be great if Mailspring would automatically switch between light and dark theme based on the user’s system setting. Almost every other app I use has this functionality.

1 Like

Would definitely love this feature, and a lot of apps are already doing it (sticking with whatever the system elects as the transition point from light/dark)

I was made a bash file, execute it via keyboard shortcut, to switch light/dark mode in Ubuntu 22.04.

With these lines below, switch Mailspring to dark theme:

pkill mailspring
sed -i ‘50 s/light/dark/’ ~/.config/Mailspring/config.json
mailspring -b

… and with these to light theme:

pkill mailspring
sed -i ‘50 s/dark/light/’ ~/.config/Mailspring/config.json
mailspring -b

Works excellent for my needs, maybe will be helpful for others…