Autodetecting GNOME Dark and Light Mode for Dotfiles Adjustments

submited by
Style Pass
2021-10-20 16:30:11

Summer is gone, and so are the bright days. This is usually the time of the year when I switch my system to to “dark” mode for the next coming months. However, my terminal and CLI applications do not detect this mode automatically. Nothing that cannot be scripted, though!

Since I switched from sway to GNOME for ease of use in daily tasks, one thing that I liked this the ability to flawlessly switch from light to dark theme in the click of a button, and admire the whole system adapt its colors almost imediately: GTK apps, as well as most websites using the correct CSS queries.

All of it? No. One has to manually switch the terminal theme from black text on white background to white text on black background. Since I am currently using the One Half themes in gnome-terminal , I have to manually switch the profile to the dark variant.

I have not found how to automate this part, but I am sure that there is some magic gsettings command to switch the default profile using the terminal. I could create a winter_is_coming.sh script to change the default gnome-terminal profile from One Half Light to One Half Dark.

Leave a Comment