Files
monitor-lets-go/contrib/monitor-lets-go.service
Maksim Totmin ac82e3e82a feat: restore portable layout on shutdown and before suspend
Add WriteConfig/Prepare backend methods (real for Hyprland, no-op for
Sway), -apply/-prepare/-no-reload CLI flags, ExecStartPre cleanup and
suspend systemd hooks so a stale docked config can never leave the
built-in display disabled after resume.
2026-08-02 12:50:37 +07:00

38 lines
1.3 KiB
Desktop File

[Unit]
Description=monitor-lets-go — automatic monitor layout daemon
Documentation=https://github.com/mat/monitor-lets-go
# Ensure the daemon starts after the graphical session is ready and
# stops when the session ends.
PartOf=graphical-session.target
After=graphical-session.target
Requires=graphical-session.target
[Service]
# Type=notify with WatchdogSec: the daemon periodically reports health.
# If it hangs, systemd kills and restarts it — critical for recovering
# from a black-screen state (restart re-evaluates monitors and applies
# the correct layout).
Type=notify
WatchdogSec=30
# Remove disabled entries from the monitor config before starting.
# Prevents black screen if a stale docked config disables the built-in
# display (e.g. after undocking while suspended).
ExecStartPre=%h/.local/bin/monitor-lets-go -config %h/.config/monitor-lets-go/config.yaml -prepare
ExecStart=%h/.local/bin/monitor-lets-go -config %h/.config/monitor-lets-go/config.yaml
# Fast restart on failure: if the daemon crashes during docked mode,
# it will be restarted within 1 second and immediately apply the
# correct layout for the current hardware state.
Restart=on-failure
RestartSec=1
# Allow up to 5 seconds for graceful shutdown (portable layout restore).
KillSignal=SIGTERM
TimeoutStopSec=5
[Install]
WantedBy=graphical-session.target