Skip to content

Persist workspace layout toggles#5403

Open
pipetogrep wants to merge 1 commit intobasecamp:devfrom
pipetogrep:preserve-workspace-layout-on-theme-change
Open

Persist workspace layout toggles#5403
pipetogrep wants to merge 1 commit intobasecamp:devfrom
pipetogrep:preserve-workspace-layout-on-theme-change

Conversation

@pipetogrep
Copy link
Copy Markdown
Contributor

@pipetogrep pipetogrep commented Apr 23, 2026

Summary

Persists the Hyprland workspace layout toggle through Omarchy's existing toggle config mechanism.

The previous implementation changed the active workspace layout with hyprctl keyword, which is runtime-only and gets reset by config reloads. The toggle now writes an explicit workspace layout rule to ~/.local/state/omarchy/toggles/hypr/workspace-layouts.conf and reloads Hyprland, matching the persistent toggle pattern already used for window gaps and single-window aspect ratio.

This relies on the existing Omarchy toggle setup to create the toggle directory. The workspace layout file itself is created by the append path the first time a workspace layout is persisted, so the command does not need to run mkdir -p or touch on every layout change.

Testing

  • bash -n bin/omarchy-hyprland-workspace-layout-toggle
  • git diff --check origin/dev...HEAD
  • Verified toggling with no existing workspace-layouts.conf creates workspace = <id>, layout:scrolling
  • Verified the persisted scrolling layout survives hyprctl reload
  • Verified the persisted scrolling layout survives omarchy-theme-set <current-theme>
  • Verified toggling the same workspace back updates the entry to workspace = <id>, layout:dwindle

@pipetogrep pipetogrep force-pushed the preserve-workspace-layout-on-theme-change branch from 3507fa1 to d3488a5 Compare April 23, 2026 14:22
@pipetogrep pipetogrep marked this pull request as ready for review April 23, 2026 14:28
Copilot AI review requested due to automatic review settings April 23, 2026 14:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dhh
Copy link
Copy Markdown
Member

dhh commented Apr 29, 2026

This is clever and a good workaround, but it also feels like something that should have a native Hyprland answer. How to make these ephemeral settings survive config reloads? Maybe @vaxerski has an idea?

@vaxerski
Copy link
Copy Markdown

they don't survive config reloads by design, that's just how the config works.

@dhh
Copy link
Copy Markdown
Member

dhh commented Apr 29, 2026

@pipetogrep Another way to do it then is via the toggles we've been using for 1-window ratio etc. Where we write the config file needed to file for it. That's probably the way to go. Then it'll also survive a reboot.

@pipetogrep pipetogrep force-pushed the preserve-workspace-layout-on-theme-change branch from d3488a5 to a651644 Compare April 29, 2026 16:33
@pipetogrep pipetogrep changed the title Preserve workspace layouts when changing themes Persist workspace layout toggles Apr 29, 2026
Store the selected workspace layout in the existing Hyprland toggle state instead of applying it with a runtime-only hyprctl keyword. Hyprland intentionally drops keyword changes on config reload, so writing a sourced config entry lets the layout survive theme changes, reloads, and reboot.

Rely on the Omarchy toggle setup to create the toggle directory, matching the other persistent Hyprland toggles. The workspace layout file is created by the append path the first time a workspace layout is persisted.
@pipetogrep pipetogrep force-pushed the preserve-workspace-layout-on-theme-change branch from a651644 to e2e3fbe Compare April 29, 2026 16:46
Copilot AI review requested due to automatic review settings April 29, 2026 16:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pipetogrep
Copy link
Copy Markdown
Contributor Author

@dhh Thanks for the feedback and the suggestion to use toggles. It's nice having the workspace layout preference be remembered after reboot!

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.

4 participants