Change GTK Theme To Dark Variant When GNOME Night Light Is On

GNOME Night Light with Dark Mode

The Night Light feature was introduced with GNOME 3.24, and it's used to make your display switch to a warmer color in the evening, helping you sleep better and prevent eye strain.

You can enable the GNOME Night Light option from Settings -> Displays -> Night Light -- you can choose to have it run automatically based on sunset / sunrise times or enable it on a manual schedule, and you can also control the color temperature.

If you'd like to extend the Night Light functionality to automatically switch to the dark variant of the GTK theme you're using when Night Light kicks in, there's a GNOME Shell extension that does just that. When the Night Light is turned off (either by you or by the schedule you set in the GNOME Settings), the theme is switched back to the regular GTK theme variant.

The extension is called Night Theme Switcher, and using it you get a combined Night Light and Dark Mode that's automatically set based on the sunset / sunrise times for the region you live in. That's all the extension does. There are no settings, or anything else for you to do other than install the extension, and enable the GNOME Night Light option. The extension requires GNOME Shell 3.28 or newer.

For this extension to work though, the GTK theme you're using on your GNOME desktop must have a -dark variant, like Yaru and Yaru-dark for example. Themes that are known to work with this GNOME Shell extension include Adwaita (the default GNOME theme), Arc, Materia, HightContrast and Yaru (the default Ubuntu 18.10+ theme).

It's worth noting that Night Theme Switcher does not change the GNOME Shell theme (e.g. the panel and menus accessed from the GNOME Shell panel). So for best results, use a dark GNOME Shell theme. In case you're using Ubuntu 19.10, see here how get dark GNOME Shell menus and dialogs with the Yaru Shell theme.

To install Night Theme Switcher, follow the GNOME Shell browser integration instructions if you haven't already, then go to the Night Theme Switcher page on the GNOME Extensions website. Next, click the OFF switch to the right-hand side of the extension name to turn it ON and install the extension.