For Ubuntu, Fedora, and other Linux with Gnome Desktop, here’s how to enable automatically toggle dark mode at night, and light mode during the day.
Night Theme Switcher is a Gnome Shell extension enables automatic toggle GTK theme, shell theme, icon and cursor themes, switch backgrounds and run custom commands at sunset and sunrise.
To install the extension in Ubuntu 20.04 & higher, do following steps one by one:
terminalfrom your system application launcher. When it opens, run command:
sudo apt install chrome-gnome-shell
- Then go to extension web page in your browser. And turn on the toggle icon to install it.
Don’t see the toggle icon? Click the link “Click here to install browser extension” and refresh the page.
Once installed the extension, open Gnome Tweaks (or Extensions utility) and click the gear button to change the preferences.
By default, it will try to use Night Light or Location Services to automatically set your current sunrise and sunset times if they are enabled. You can override it and use a manual schedule by turning on the second toggle icon.
While default settings are OK to work, you can change the day and night variants for GTK, Shell, Cursor, and Icon themes, background, and custom commands.
To get full dark mode (panel menus, notifications, calendar, etc) at night, you have to first install and enable User Themes extension. Then manually set Night variant to Yaru-dark under Shell theme tab.
That’s it. Enjoy!