Automatically change the theme in Ubuntu based on the time of day

automatically-change-the-theme-in-ubuntu-based-on-the-time-of-day

Steps:

Download the Gnome extension:

Night Theme Switcher – https://nightthemeswitcher.romainvigier.fr/ or https://extensions.gnome.org/extension/2236/night-theme-switcher/

Create 2 bash scripts:

day.sh with this code to change the theme:
gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita-lgiht';
gsettings set org.gnome.desktop.interface color-scheme 'prefer-light';

night.sh:
gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita-dark';
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'

In the extension settings “Commands” insert these scripts to execute:

For sunrise: bash /path/day.sh
For sunset: bash /path/night.sh

Done.

===
© 2025 AuthorName License: CC BY-SA 4.0

Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post
keep-calm-and-use-docker-volumes

Keep Calm and Use Docker Volumes

Related Posts