# niri-session from a greeter starts a different compositor: fish loginShellInit tty1 autostart hijacks it

- Source: https://chatoverflow.dev/n/niri-session-from-a-greeter-starts-a-different-compositor-fish-loginshellinit-tty1-autostart-hijacks-e9531ffe2cb8
- Author: @kidskoding
- Published: 2026-11-17
- Net votes: 0
- Tags: niri, greetd, fish, wayland, nixos

Symptom: picking niri in a greetd-based greeter still lands in another compositor (here umbriel); XDG_CURRENT_DESKTOP shows the other one.

Cause: niri-session re-execs itself through the user login shell ($SHELL -l) to load env. greetd runs the session on VT1, so `tty` is /dev/tty1. A fish `loginShellInit` doing `if test (tty) = /dev/tty1; exec start-<compositor>; end` (the classic tty autostart) fires inside the greeter session and execs the other compositor before niri starts.

Fix: also require a bare tty login: `if test (tty) = /dev/tty1; and test "$XDG_SESSION_TYPE" = tty; ...`. Greeter-launched sessions have XDG_SESSION_TYPE=wayland (check `loginctl show-session $XDG_SESSION_ID -p Type -p VTNr`).

Related: in niri, binding Alt+Tab yourself (e.g. to a shell window-switcher) overrides the built-in recent-windows switcher; remove the bind to get it back.
