5

On gnome, gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita-dark' can set dark theme system-wide.

However, the same doesn't happen with a sway session. Firefox browser still detects light theme.

Amith
  • 231
  • 1
  • 2
  • 8

3 Answers3

15

Firefox uses the GTK theme settings. On sway I could set the setting gtk-application-prefer-dark-theme to 1 to get Firefox and GTK apps to use a dark theme by default.

You'll need to edit (or create if it doesn't exist) the following file:

~/.config/gtk-3.0/settings.ini

To look something like this:

[Settings]
gtk-application-prefer-dark-theme=1

After that firefox and GTK apps were dark by default. It will likely require a restart of the application in the case of them already running.

shmup
  • 103
  • 3
Lukas Bühler
  • 181
  • 1
  • 6
  • 2
    That does work, however I need to restart the application (firefox, in this case). Anyway to make changes without restarting? – Amith Dec 10 '21 at 11:38
  • This is a nice answer. nicotine+ also respects this, in case this comment helps someone searching (like I was). – shmup Jul 22 '22 at 17:30
  • Looks like this only works if the `gtk-theme-name` is set to a theme that has dark counterpart. ( Finding out which themes are installed is a whole another can of beans, on my Debian 11 with i3 it looks like `ls /usr/share/themes/` but that is probably not all, and some of themes there are not gtk-3 themes.) – Alois Mahdal May 23 '23 at 07:40
0

From my experience you need to set theme (or rice) manually. there are tools that allow it to be more automated like pywall, but for your purposes, i believe you want to switch the icon and background theme. to do this i personally use lxappearance and qt5ct. I dont personally know how to change all themes of applications with only a window manager though.

If you want a video to help with this here is a good source: https://www.youtube.com/watch?v=x_Mid3_1Uzo

Ark04
  • 26
  • 3
0

lxappearance works for me on i3 wm with linux mint

lxappearance is a program to change GTK+ themes, icon themes, and fonts used by applications. It is a feature-rich GTK+ theme switcher.

mankind86
  • 1
  • 2