I’m a semi-recent NixOS user and one thing that bothers me since the beginning is that when I change the Gnome theme (between light and dark), Firefox doesn’t adapt. The system theme in Firefox is enabled, but it always displays the light theme, no matter what theme is selected in Gnome.

Internet search, including searching through NixOS discourse, packages, options and Nixpkgs repo surfaced a solution.

Any ideas or tips how to achieve system theme integration for Firefox on NixOS?

NixOS 23.11 / Gnome 45 / sway

  • algernon@lemmy.ml
    link
    fedilink
    arrow-up
    3
    ·
    10 months ago

    Works out of the box here, NixOS 23.11 / GNOME 45 / X11, so I suspect this might be either a Wayland or Sway problem.

    When I switch to dark mode in GNOME, both Firefox’s UI, and the sites that support dark mode, switch.

    • 0xCAFe@feddit.deOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      10 months ago

      Hm, thanks for sharing. Maybe a clean install will sort out the issue. Should try that when I’ll have some time.

      • algernon@lemmy.ml
        link
        fedilink
        arrow-up
        1
        arrow-down
        1
        ·
        10 months ago

        I would suggest trying with Wayland + GNOME, using GNOME’s default WM, rather than sway. If that works, and sway doesn’t, then the issue is somewhere between GNOME and Sway. That should help narrow things down.

        • 0xCAFe@feddit.deOP
          link
          fedilink
          English
          arrow-up
          2
          ·
          10 months ago

          I removed an environment variable XDG_CURRENT_DESKTOP = "sway"; (which I added long ago from some tutorial) and it solved the issue. Thank you for your input! :)

  • callyral [he/they]@pawb.social
    link
    fedilink
    English
    arrow-up
    1
    arrow-down
    1
    ·
    edit-2
    10 months ago

    I have this in my config and I use Hyprland:

    {
      dconf.settings = {
        "org/gnome/desktop/interface" = {
          color-scheme = "prefer-dark";
        };
      };
    }
    
    • 0xCAFe@feddit.deOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      10 months ago

      Thank you for the comment, this is not what I’m looking for however. I want a) a dynamic system theme (I already can manually change it to “dark”) which I use a Gnome extension for and b) that Firefox follows the system theme.