NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.39k stars 14.34k forks source link

nixos/regreet: greeter spans multiple monitors #226586

Open Lord-Valen opened 1 year ago

Lord-Valen commented 1 year ago

Describe the bug

The default behaviour for cage is to "Extend the display across all connected outputs". The greeter therefore spans across all monitors. In multihead setups, this often results in the login prompt being split between two or more monitors. For obvious reasons, that isn't desirable.

Steps To Reproduce

Steps to reproduce the behavior:

  1. programs.regreet.enable = true
  2. services.greetd.enable = true
  3. Have multiple monitors
  4. On greetd start, observe that the greeter spans across all monitors

Expected behavior

The greeter appears on one monitor or appears separately on each monitor.

Additional context

cage -m last should restrict cage to the last connected device but that results in an otherwise blank screen with the following error:

Failed to create /var/empty/.cache for shader cache (Operation not permitted)---disabling.

Notify maintainers

@fufexan @Peter015

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.23, NixOS, 23.05 (Stoat), 23.05pre-git`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.13.3`
 - channels(lord-valen): `""`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
fufexan commented 1 year ago

I'm not sure what the best course of action is here. We could set sway as the default runner for the greeter, but it's a bit of a stretch to enable it by default in my opinion. I use it and it works fine, but I'm not sure whether users would want sway to be the default. Configuring it is also more involved.

If you wish to use sway to get around this problem, you can take a look at my configuration.

Lord-Valen commented 1 year ago

If we want to stick with just cage in the module, it's probably best to see if we can get -m last working for now. Or wait for https://github.com/cage-kiosk/cage/issues/247 implementation, though cage's development velocity has slowed down significantly.

Alternatively, we could add a compositor option to the module, giving the option to switch between cage and a minimal sway configuration (and possibly others in the future).

Ma27 commented 1 year ago

As a workaround until then you might be interested in https://github.com/NixOS/nixpkgs/pull/261816.