There is a way to set gnome apps to prefer dark theme through command line?

Hi. I was trying schedule a task to tell all apps to prefer dark theme after sunset and I found a setting called gtk-application-prefer-dark-theme.

I did try make it throught gsettings, with following command:

$ gsettings set org.gnome.desktop.interface gtk-application-prefer-dark-theme true
# but this happened
No such key “gtk-application-prefer-dark-theme”

Looks like this key was deprecated, but looking on official docs we can see that not, it is still working (https://developer.gnome.org/gtk3/stable/GtkSettings.html#GtkSettings--gtk-application-prefer-dark-theme).

What am I doing wrong? There is a way to tell Chrome, Firefox, visual-studio-code and all gtk apps that I prefer dark mode, like we can do on Windows 10 and MacOS?

If so, how?

[EDIT]
You can’t.

GtkSettings has nothing to do with GSettings, so you cannot set that property with gsettings.

You’re not supposed to use GtkSettings:gtk-application-prefer-dark-theme to get a dark theme for all GTK3 applications; that property is for application developers to set.

You will need to set the desktop theme name to a dark theme, instead.

OK, but it doesn’t work to tell Chrome and others GTK apps that current theme is a dark theme. I will assume that this option is currently not available for Gnome.

Thank you for your fast response.

gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita-dark'

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.