Dark/light theme switching with Sway

Hello,

I use sway configured with nixos and home-manager. How do I make pkgs.darkman work? No application change when I do darkman set dark or vice versa. However when I log into my plasma6 installation and switch themes there and then log back into sway it works.

I setup the xdg.portals.wlr and gtk

xdg.portal = {
enable = true;
wlr.enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
};

Maybe this isn’t the right forum to ask on. I also searched github for uses of darkman and didn’t lear anything.

Anybody have this setup or something similar, any help would be very appreciated :smiley:

1 Like

Hi,

Although I run darkman in a slightly different setup (Niri) I guess this should be equally needed:

portal = {

  config.niri = { # Replace niri with Sway or just configure it as the default.
    "org.freedesktop.impl.portal.Settings" = [ "darkman" ];
  };
};

After that, every application should more or less work as expected. Here is the relevant section of the upstream docs.