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.
This commit is contained in:
Maksim Totmin
2026-08-02 12:50:37 +07:00
parent 3fdccadd3c
commit ac82e3e82a
9 changed files with 318 additions and 16 deletions
+20
View File
@@ -0,0 +1,20 @@
[Unit]
Description=monitor-lets-go -- restore portable layout before suspend
Documentation=https://github.com/mat/monitor-lets-go
# Run before the system enters sleep. The ExecStop action writes a portable
# monitor config so that on resume the compositor never loads a stale docked
# config that would leave the built-in display disabled.
Before=sleep.target
[Service]
# RemainAfterExit: ExecStop runs when the service is stopped (before sleep).
# This is the standard pattern for systemd suspend hooks.
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/true
ExecStop=%h/.local/bin/monitor-lets-go -config %h/.config/monitor-lets-go/config.yaml -apply portable -no-reload
[Install]
WantedBy=sleep.target