Persist workspace layout toggles#5403
Conversation
3507fa1 to
d3488a5
Compare
There was a problem hiding this comment.
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.
|
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? |
|
they don't survive config reloads by design, that's just how the config works. |
|
@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. |
d3488a5 to
a651644
Compare
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.
a651644 to
e2e3fbe
Compare
There was a problem hiding this comment.
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 Thanks for the feedback and the suggestion to use toggles. It's nice having the workspace layout preference be remembered after reboot! |
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.confand 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 -portouchon every layout change.Testing
bash -n bin/omarchy-hyprland-workspace-layout-togglegit diff --check origin/dev...HEADworkspace-layouts.confcreatesworkspace = <id>, layout:scrollingscrollinglayout surviveshyprctl reloadscrollinglayout survivesomarchy-theme-set <current-theme>workspace = <id>, layout:dwindle