Automatically change the theme in Ubuntu depending on the time of day
Irvirty

Irvirty @irvirty

About: Europe. He/him. Web design and web development. Content is licensed under CC BY-SA 4.0 license.

Location:
Europe
Joined:
Apr 2, 2025

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

Publish Date: Oct 16
0 0

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.

Comments 0 total

    Add comment