Skip to content

Add graphical session saver - #10353

Open
jordanhubbard wants to merge 1 commit into
omacom:quattrofrom
jordanhubbard:feat/session-saver
Open

Add graphical session saver#10353
jordanhubbard wants to merge 1 commit into
omacom:quattrofrom
jordanhubbard:feat/session-saver

Conversation

@jordanhubbard

Copy link
Copy Markdown

Goal

Preserve desktop continuity across Omarchy logins by restoring applications that can be safely launched from their desktop entries, along with their Hyprland workspace and window placement.

What this adds

  • Adds omarchy-session, a user-facing command that saves, restores, watches, and reports the session state.
  • Adds omarchy-session.service, tied to graphical-session.target and gated on WAYLAND_DISPLAY. It restores once when the graphical session starts, snapshots every 10 seconds while it runs, and performs a final save when it stops.
  • Persists a schema-versioned JSON snapshot atomically under $XDG_STATE_HOME/omarchy/session/last.json.
  • Maps Hyprland window classes to desktop entries through StartupWMClass, then restores only launchable applications using gtk-launch rather than retaining volatile process data.
  • Restores workspace, floating state, floating size and position, and fullscreen state after each app opens.
  • Excludes Omarchy Quickshell windows and strips ephemeral fields such as addresses and PIDs from saved state.
  • Installs the unit in the package defaults and enables it during first-run user-unit setup.

Verification

  • bash test/shell.d/session-test.sh
  • bash test/shell.d/systemd-test.sh
  • ./test/cli
  • git diff --check

The focused session test stubs Hyprland client data and verifies durable, schema-versioned state; desktop-entry resolution; and omission of Quickshell and transient window addresses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant