# The hyprland.conf for a session nobody sits in front of. # # Split out of module.nix so the rendering is readable on its own (and diffable # when an output list changes). Returns the file *text*; the caller puts it in # the store. { lib, outputs, extraConfig, }: let # `monitor = , x@, auto, ` -- "auto" # lets the compositor lay the outputs out left to right. # # The name is a *rule selector*, not an output the compositor will create: it # is matched as a regex against the names the backend hands up (`eDP-1`, # `Virtual-1`, ...). Hyprland never invents an output to satisfy a rule, so a # name that no connector has is a rule that is silently ignored. # # An empty name is the wildcard form -- the same shape as Hyprland's own # shipped `monitor=,preferred,auto,1` -- and applies to every output the # machine actually has. That is what a session which does not know the host's # connector names wants, and it is the module's default. monitorLine = o: "monitor = ${o.name}, ${toString o.width}x${toString o.height}@${toString o.refresh}, auto, ${toString o.scale}"; in '' # Generated by services.hyprland-headless-stream. Do not edit. # # There is no seat, no libinput device, no cursor and no human here: the only # consumer of this session is the frame server. Everything below either sets # the mode of the outputs this machine has or switches off something that # assumes a user. ${lib.concatMapStringsSep "\n" monitorLine outputs} misc { # Nothing should draw itself over the captured output. disable_hyprland_logo = true disable_splash_rendering = true force_default_wallpaper = 0 background_color = 0x000000 # The config lives in the store and never changes under us; watching it # would only cost inotify watches on a read-only path. disable_autoreload = true # A virtual output has no variable refresh rate to negotiate. vrr = 0 # DPMS on a virtual output is meaningless, and there is no key or pointer # event coming to wake it back up. key_press_enables_dpms = false mouse_move_enables_dpms = false # Both of these check for a desktop that is not here: the Qt helper # dialogs, and the XDG portal environment. disable_hyprland_guiutils_check = true disable_xdg_env_checks = true } debug { # Capture wants a steady frame rate. With variable frame rate the # compositor only renders on damage, so an idle session would starve the # stream. vfr = false # The session is a systemd unit: its log belongs in the journal, not in a # file under a runtime directory nobody will look in. enable_stdout_logs = true colored_stdout_logs = false } cursor { # No hardware planes, no cursor theme on disk, nobody to warp. invisible = true no_hardware_cursors = true enable_hyprcursor = false no_warps = true hide_on_key_press = false inactive_timeout = 0 } input { # Focus follows the pointer. This was `0`, on the reasoning written here # that no pointer would ever exist — true when it was written, and false # now that the broker injects one. # # It is not a preference. With `0` Hyprland delivers pointer events only to # the keyboard-focused window: measured in `vm-pointer`, a click aimed at # 0.25,0.75 of a session's container placed the cursor at x=299 y=519, # inside that window, and **both** clients reported nothing — the click was # aimed correctly and delivered nowhere. The cursor lease already # serialises input, so letting the pointer move keyboard focus cannot make # two sessions fight over the keyboard. # # It is also what moves the KEYBOARD, which matters now that the broker # injects keys as well: a virtual keyboard is seat-global and has no # output, so the warp is the only thing that decides which window the # letters land in, and the lease is what stops another session retargeting # them mid-string. follow_mouse = 1 # Set explicitly, at its default value, because `pointer acquire` now # depends on it rather than merely benefiting from it. # # MEASURED (tests/README-keyboard-probe.md): one warp onto an idle cursor # delivers `wl_pointer.enter` and NO `wl_keyboard.enter`. Hyprland's # `onMouseWarp` goes through `mouseMoveUnified(refocus=false)`, which # *sets* `m_mousePosDelta` to 0 when the previous movement was more than # 0.5 s ago, and keyboard focus is that delta compared against this # threshold. So acquire sends two motions a real pixel apart: the second # carries a non-zero delta, and `> 0` is true only because this is 0. # # Raise it and `hhstream session pointer acquire` stops taking keyboard # focus — the cursor would land in the session's window and the first # keystroke would go to whatever was focused before. follow_mouse_threshold = 0 # Release a virtual keyboard's held keys when its resource is destroyed. # # MEASURED, and the default is `false`: `destroy` with a key down # delivered no key-up at all. That is worse than a stuck key, because # `InputManager::onKeyboardKey` *drops* a press whose code is already in # the seat's `m_pressed` — so a driver killed with `-9` leaves that code # there and the next driver's press of it is ignored. The key is dead, # not merely held, and nothing in the logs says so. # # The driver's own shutdown path lifts keys first # (`hhstream_pointer.__main__._lift_everything`) and SIGKILL skips it; # this is the backstop for that case. # # It does NOT clear the modifier mask: `releasePressed` emits key-ups and # never a `modifiers`, and a client keeps the last mask it was sent. That # is why `release_all` ends with `modifiers(0, 0, 0, 0)` on every path we # control, and why this setting is a backstop rather than the mechanism. virtualkeyboard { release_pressed_on_close = true } } # Frames cost capture bandwidth and CPU, and no one is watching the easing. animations { enabled = false } decoration { blur { enabled = false } shadow { enabled = false } } # Nothing here may reach the network or nag a user who is not there. ecosystem { no_update_news = true no_donation_nag = true } ${lib.optionalString (extraConfig != "") "\n${extraConfig}"}''