Files
moonarch/defaults/xdg/stasis/stasis.rune
T
nevaforget 9689845936 fix(stasis): give the desktop plan its own dpms and lock steps
A machine without a battery never blanked and never locked. stasis builds
the desktop plan from the blocks directly under `default:` and excludes
the ac:/battery: containers (src/config/mod.rs:180-183, :230-233), so a
config that keeps every step inside those containers leaves the desktop
plan empty. select_plan_source only falls back onto the desktop plan,
never from it onto ac: (src/core/config.rs:288-306), and the last-resort
rebuild_plan_default_order() builds from blocks the parser has already
disabled — a plan of disabled steps.

dpms (120s) and lock_screen (180s) now sit directly under `default:`,
timeouts matching the ac: plan. Deliberately only those two: brightnessctl
cannot drive external monitors, and suspending a desktop is a separate
decision from idle screen handling.
2026-08-25 09:45:10 +02:00

112 lines
3.0 KiB
Plaintext

# Stasis idle manager configuration for Moonarch
# Manages screen dimming, DPMS, lock, and suspend timers
@author "Moonarch"
@description "Idle management for Moonarch (Niri + swaylock)"
default:
# monitor_media: detect active media via PipeWire/PulseAudio sink-inputs
# (pactl), not MPRIS. Non-browser players (mpv, vlc, ...) are counted and
# inhibit idle. Browser audio is excluded by design; browser idle-inhibit is
# expected via D-Bus (enable_dbus_inhibit), which Waterfox/Firefox only send
# in fullscreen -- so windowed browser video is NOT caught by stasis.
# ignore_remote_media false: also count remote players (Spotify-remote,
# KDEConnect, Chromecast); has no effect on windowed browser video.
monitor_media true
ignore_remote_media false
# App/process inhibit patterns (apps that don't use D-Bus idle-inhibit)
inhibit_apps [
"vlc"
"mpv"
"celluloid"
r"steam_app_.*"
"gamescope"
"virt-manager"
"qemu"
"obs"
"kdenlive"
"handbrake"
"blender"
]
# Lid actions (laptop only)
lid_close_action "swaylock -f"
lid_open_action ""
# Desktop plan (machines without a battery)
#
# These blocks sit directly under `default:` on purpose: stasis builds the
# desktop plan from exactly those, with the ac:/battery: containers excluded
# (src/config/mod.rs, parse_plan_block "default"). A machine whose chassis
# reports no battery gets PlanSource::Desktop, and select_plan_source only
# ever falls back *onto* the desktop plan, never from it onto ac: -- so with
# the action blocks living in ac:/battery: alone, a desktop ran a plan of
# disabled steps: no DPMS, no lock, "waiting for idle" forever.
#
# Timeouts match the ac: plan below, so a docked laptop and a desktop behave
# alike. Deliberately only two steps:
# brightness -- brightnessctl drives an internal panel; external monitors
# need DDC/CI, which it does not speak.
# suspend -- suspending a desktop is a separate decision, not part of
# idle screen handling.
dpms:
timeout 120
command "niri msg action power-off-monitors"
resume_command "niri msg action power-on-monitors"
end
lock_screen:
timeout 180
command "swaylock -f"
end
# AC power plan (relaxed)
ac:
brightness:
timeout 300
command "brightnessctl set 50%"
end
dpms:
timeout 120
command "niri msg action power-off-monitors"
resume_command "niri msg action power-on-monitors"
end
lock_screen:
timeout 180
command "swaylock -f"
end
suspend:
timeout 600
command "systemctl suspend"
end
end
# Battery plan (aggressive)
battery:
brightness:
timeout 60
command "brightnessctl set 30%"
end
dpms:
timeout 30
command "niri msg action power-off-monitors"
resume_command "niri msg action power-on-monitors"
end
lock_screen:
timeout 60
command "swaylock -f"
end
suspend:
timeout 120
command "systemctl suspend"
end
end
end