Some loose ends for sway on nixos which we should fix

Using gsettings to switch themes on the fly does work for me.

Great to hear!

Can you share with me an excerpt of your related config?

My entire config is open-source. Sway config is here, theme config is here.

1 Like

Hi, your nixos-configs are really amazing, thank for make it public. Really well ordered modules system. Thanks I’m learning a lot and feel shame of my configs :slight_smile: I tried to adjust my sway/theme to your config but still it doesn’t work. Also surprised you dont need some workaround I do. For instance:

How do you solve the message error??

$> gsettings set org.gnome.desktop.interface gtk-theme Adwaita-dark
No schemas installed

without the workaround: = [

I disabled the xdg.portal.wlr.enable flag and things seems to run smoothly, including screencast and screenshots. The GNOME config seems to take care of what’s needed.

That’s fixed by home-manager because of this setting

I’m scraping HM code but not sure what exactly this module add to system config. In any case I have it enabled and no schemas yet.

It doesn’t really add anything to the sway config. It instructs the nixpkgs derivation to include the gappsWrapperHook. Not sure why it doesn’t work for you, when I had similar “no schemas installed” issues that was the fix.

I cherry pick this

then I have schemas into sway again. But still gtk3 apps (mainly firefox-esr and ungoogled-chromium) ignoring theme (Adwaita-dark) o color-scheme (prefer-dark) setting.

I’ve been trying for days to get sway working in a UTM vm on an M1 Mac. I tried using the sway configuration from this discussion but my vm just boots to a console login. Here is my vm’s configuration. Is there something obvious I’m missing?

You should probably open a new topic for this.

Looking at your config. It seems that you have not enabled any login manager (GDM/Ligthdm/greetd/…). That would explain why nixos boots to the console.

Thanks, that helps me with the next part of this puzzle. I think this topic is a good place for this. It would be nice if the sway wiki page told you all the configurations that are needed for it to work. For example just mentioning that you need to import the sway file in your configuration.nix would be great for beginners to NixOS.

In regard to login managers, it would be good to have an example on the sway wiki as well. I only see lightdm examples within xserver configurations, I saw a comment that GDM doesn’t work with sway, and I finally found a greetd example on GitHub which I tried. I still boot to a console login, but after logging in I have a blank black screen.

Login managers are not officially supported by the sway devs (Useful add ons for sway · swaywm/sway Wiki · GitHub), which makes me a little wary of adding one to the new wiki. Part of the issue with the old wiki was that it was attempting to do a bunch of stuff that the sway devs don’t support, so it went stale very quickly. The new wiki is designed to just do everything exactly how the sway devs recommend. This maximizes the chance that someone new can show up and get sway running with gtk theming and dbus integration without too much effort.

It is possible to get sway working with a login manager (e.g Debian does this), but it would be up to us to make sure that the login manager and sway remain compatible. The hard part is making sure all the environment variables are being propagated correctly.

@cswank: Can you not just run sway after logging in to a terminal? This is the recommended way of running sway.

@danielbarter that makes total sense, thanks for explaining the rational for not including a login manager in the example.

Running sway after logging in via terminal doesn’t work either. My terminal hangs and I have to reboot my vm via ssh. This is probably a good time to start a new topic to get help.

1 Like

definitely sounds like a more serious issue. You can get full debug logs by running sway --debug.

1 Like

More googling suggests this is an issue with sway and qemu, so I don’t think this is a good place to solve the problem.

I can’t remember where I took it from, but I got sway working with GDM perfectly. Here’s a gist of sway related parts of my config: configuration.nix sway bits · GitHub

Hosted by Flying Circus.