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:
@@ -96,6 +96,18 @@ type Backend interface {
|
||||
// are enabled is ever visible.
|
||||
ApplyLayout(ctx context.Context, monitors []MonitorConfig) error
|
||||
|
||||
// WriteConfig persists the monitor configuration to disk without
|
||||
// reloading the compositor. Used during shutdown (SIGTERM) when
|
||||
// the compositor may not be available. For backends that don't
|
||||
// use a config file (e.g. Sway), this is a no-op.
|
||||
WriteConfig(ctx context.Context, monitors []MonitorConfig) error
|
||||
|
||||
// Prepare ensures the monitor config file has no disabled entries.
|
||||
// This prevents the "no active displays" issue when the compositor
|
||||
// starts with a stale config. For backends that don't use a config
|
||||
// file (e.g. Sway), this is a no-op.
|
||||
Prepare(ctx context.Context) error
|
||||
|
||||
// Events returns a channel of hotplug events and a channel of errors.
|
||||
// The caller must read from both channels. When ctx is cancelled,
|
||||
// the backend closes both channels and stops listening.
|
||||
|
||||
Reference in New Issue
Block a user