Skip to content

Add a floating mode with titlebars to the workspace layout cycle - #14482

Merged
dhh merged 32 commits into
quattrofrom
floating-desktop
Oct 11, 2026
Merged

dhh merged 32 commits into
quattrofrom
floating-desktop

Conversation

@ryanrhughes

@ryanrhughes ryanrhughes commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Adds a floating mode to the Super + L workspace layout cycle, and gives floating workspaces titlebars in the current theme's colors. This PR includes #8260's commits (#8260 was closed in favor of this one) and #14973, which adds the Trigger > Appearance menu.

What it does

  • Super + L cycles dwindle → scrolling → floating. On a floating workspace every window floats. Leaving floating tiles only the windows the mode floated (tagged omarchy-mode-floated), so apps that always float, dialogs and pinned windows keep floating.
  • The bar shows each layout. The focused workspace's mark is a square for dwindle, a circle for scrolling, and a triangle for floating, and clicking it cycles the layout as Super + L does.
  • Titlebars on every window of a floating workspace, with maximize and close buttons. Double-click a titlebar to maximize while keeping the top bar visible. The bar uses the theme's lighter_background, falling back to selection on themes where that equals the background, so it stands apart from the window under it. Titles show the app's name: a web app reads "WhatsApp" rather than web.whatsapp.com, and the close and maximize buttons highlight on hover.
  • A default workspace layout under Trigger > Appearance > Workspace Layout: Tiling, Scrolling, or Floating, for every workspace without a layout of its own. A tiled default is Hyprland's own layout; a floating one is the floating mode. omarchy-hyprland-workspace-layout-default sets it from a terminal, and workspaces given a layout with Super + L keep theirs.
  • Floating workspaces focus on click. Shadows are shown only on floating windows. Windows can now be resized from their borders on tiled workspaces too.

There's no minimizing and no edge snapping: an earlier version of this PR had a Shelf for minimized windows and drag-to-edge snapping, and both were removed.

How it fits together

  • default/hypr/workspace-modes.lua holds the mode. Hyprland has no tiled layout called floating, so the mode floats the windows themselves and tags what it floated. A second tag (omarchy-floating-workspace) marks every window on a floating workspace, and titlebars, shadows and opacity follow it. After every config load, a reconciliation pass brings open windows in line with the saved modes.
  • The titlebars come from omarchy-hyprland-titlebars, a native Hyprland plugin forked from hyprbars, now in its own repository, omacom/omarchy-hyprland-titlebars. Build omarchy-hyprland-titlebars from its own repository, and move pins on rebuilds omarchy-pkgs#957 builds v0.2.0 from it, with app-name titles and button hover, and makes Hyprland rebuilds move the plugin's hyprland= pin. The config only loads it while something floats; Hyprland unloads it at the first reload that no longer asks for it. If the package is missing, floating still works without titlebars. The plugin has to be rebuilt for every Hyprland release.
  • omarchy-hyprland-workspace-layout-current reports a workspace's mode, and omarchy-hyprland-workspace-layout-default shows or sets the default layout.
  • migrations/1791403310.sh installs the titlebar package for existing systems.
  • Web app launchers carry StartupWMClass, the window class Chromium gives the app's window, so the plugin can find the launcher's name. omarchy-webapp-window-class works it out from the URL; omarchy-webapp-install and the shipped web apps write it, and migrations/1791696584.sh adds it to existing launchers.

Named workspaces (#12947)

The layout toggle used to act on a named workspace's negative id, which Hyprland reads as a relative selector, so pressing Super + L on a named workspace reconfigured workspace 1 and saved that at every login. The toggle now leaves named workspaces alone, and migrations/1787679775.sh removes layout files saved for them. This stops the wrong-workspace bug but doesn't make the toggle work on named workspaces, which is what #12947 asks for, so it doesn't close that issue.

Testing

  • test/shell.d/hyprland-floating-workspaces-test.sh covers the reconciliation pass, the default layout, special workspaces being left alone, titlebar loading and theming (including the fallback color), and that snapping stays off.
  • test/shell.d/hyprland-workspace-layout-test.sh covers the cycle, the saved modes and named workspaces.
  • The bar, menu, keybindings menu, default config, preinstalls and ./test/cli suites pass.
  • Live on an XPS 13 with the published plugin: Super + L into floating shows titlebars, the titlebar color is lighter_background on the current theme, and Hyprland reloads without config errors.

🤖 Generated with Claude Code

dhh and others added 4 commits August 25, 2026 18:12
Lua 5.5's standalone interpreter exits 0 when the script that raised the error came in on stdin, and exits 1 for the same error in a script file. The block here was piped in through a heredoc, so every assertion in it reported as passing however wrong the value was: changing the expected layout to one the toggle never writes still left the file green.
Super + L cycled a workspace between dwindle and scrolling. It now carries on into floating, where every window on the workspace floats.

Floating cannot be a third `layout` on the workspace rule. Hyprland has no layout by that name and accepts one anyway: `hl.workspace_rule({ layout = "floating" })` returns ok and silently leaves the workspace on dwindle, exactly as a misspelt name does. So the mode floats the windows themselves, through the same `float` dispatcher SUPER + T uses.

Ending the mode has to tile the windows the mode floated and only those, so each one is tagged with `omarchy-mode-floated`. A window already floating when the mode reaches it -- an app with a float rule of its own, a dialog, one popped out with SUPER + T -- is left unclaimed and is still floating when the mode ends. The tag lives on the window rather than in a table here: it dies with the window, follows it between workspaces, and survives the config reload that plugging in a monitor performs, none of which a table on this side would do. A pinned window is left alone entirely, because tiling one unpins it as well.

Windows arrive on a workspace three ways and a window rule only covers one of them, so the mode watches events: window.open for what opens there, window.move_to_workspace for what is carried in, and the same event for what is carried back out, which gives up the floating the mode gave it rather than staying floating on a workspace that tiles. Every tiled window is claimed before any of them is floated, because floating one member of a group floats the rest, and claiming as it went would find those already floating and leave them stranded.

The mode is read back from the saved file rather than from the compositor. Hyprland reports a workspace's tiled layout and floating is not one, so a floating workspace still answers dwindle or scrolling; trusting that answer would skip a step of the cycle. A file saved before floating existed names a layout rather than a mode and falls through to what Hyprland reports, so the cycle keeps working and the next press rewrites it.

Two faults in the old script had to go first, because saving the mode makes both persistent. Named workspaces report a negative id, which passed the `^-?[0-9]+$` guard, and Hyprland reads a leading "-" as a selector relative to the current workspace: pressing Super + L on a named workspace reconfigured workspace 1 instead, and would now save a file that did it again at every login. And the saved state was written under $HOME/.local/state while the Hyprland side reads XDG_STATE_HOME, which also had to reach package.path: the loader lists that directory but loads the files by module name, so a state home anywhere else listed the saved layouts and then loaded same-named ones from the home directory.

Saving is checked too. The mode reaching the compositor and the mode reaching disk are separate things that can fail separately, and a save that failed silently would leave the next press reading a file that never got written, cycling between two modes and never reaching the third.

The guard against named workspaces stops new files being written, but an earlier version already wrote them, and they go on being loaded at every login. A migration removes the saved layouts named for a negative id.

The keyword fallback is gone. `hyprctl keyword` refuses a Lua configuration outright -- "keyword can't work with non-legacy parsers. Use eval." -- and exits 0 while doing so, so as a fallback it neither worked nor reported that it had not. A failed apply now says so and saves nothing, rather than announcing a layout the screen does not show and restoring it at the next login.

Co-Authored-By: Codex XHigh <[email protected]>
Floating workspaces become a traditional desktop that works with every
theme. Windows get themed titlebars from the omarchy-hyprland-titlebars
plugin, which is loaded only while something floats. Dragging a titlebar
to the left or right edge snaps the window to that half, and dragging it
to the top or double-clicking maximizes it. The window floating mode
places is sized, centered, and cascaded, and floating workspaces focus
on click.

Super + M, or the minus button, sets a window aside on the Shelf, which
works from any workspace and restores the window onto the current one
in that workspace's layout. Float All Workspaces makes floating the
default while Super + L still sets a single workspace's layout.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@greptile-apps

greptile-apps Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

[Medium impact] Adds floating workspace mode and updates web app window naming.

The PR should not merge until the launcher migration preserves existing files when a write fails.

Findings

  1. P1 Failed writes break existing launchers ▶
  2. P2 Failed saves look successful ▶

Summary

Adds floating workspaces to the layout cycle, with themed titlebars and a selectable default layout.

  • Adds layout marks and click-to-cycle behavior to the bar.
  • Saves workspace modes and adds migrations for existing layouts and web-app launchers.
  • No additional findings were accepted.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A["Keyboard shortcut or bar click"] --> B["Choose the next workspace mode"]
  B --> C["Apply the mode"]
  C --> D["Save an override or follow the default"]
  D --> E["Refresh the bar"]
  D --> F["Reload when titlebars need loading"]
  F --> G["Load saved modes and reconcile open windows"]
Loading

Reviews (8) · Last reviewed commit: "Merge remote-tracking branch 'origin/qua..." · Reviewed by Greptile

Comment thread default/hypr/workspace-modes.lua Resolved
Comment thread default/hypr/workspace-modes.lua Resolved
Comment thread bin/omarchy-hyprland-window-minimize Resolved
Comment thread default/hypr/workspace-modes.lua Resolved
dhh and others added 2 commits October 8, 2026 08:35
Turning Float All Workspaces off with no workspace layouts left behind
started nothing to give the floated windows back. A window fullscreen
when its workspace began floating now floats once it leaves fullscreen.
A window whose Shelf note cannot be saved stays where it is, and the
titlebars read the theme from where omarchy-theme-set writes it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@jandrusk

jandrusk commented Oct 8, 2026

Copy link
Copy Markdown

This is a big, nicely structured feature. A few notes from a first pass:

  • The description is out of date. Cycle Super + L on into a floating workspace #8260 was closed yesterday as superseded by this PR, so the diff won't shrink. It's worth updating the first paragraph so reviewers know the Super + L floating cycle, workspace-modes.lua, and migrations/1787679775.sh are part of what's under review here.
  • Blocking until the package exists, as your checklist says. migrations/1791403310.sh runs omarchy-pkg-add omarchy-hyprland-titlebars under omarchy-migrate's set -euo pipefail, and install/omarchy-base.packages lists it, so both updates and fresh installs fail until it's published. The per-Hyprland-release rebuild of a native plugin is also an ongoing maintenance cost the maintainers will want to weigh.
  • Nit: omarchy-hyprland-window-minimize runs omarchy-bar put omarchy.shelf … on every minimize. That respects a Shelf the user moved, but it re-adds one they deliberately removed from the bar. Maybe only put it back when the Shelf has never been placed, or skip it when the user has removed it.
  • This also looks like it fixes Workspace layout toggle (dwindle/scrolling) never applies to named workspaces — rule keyed by negative workspace id never matches #12947 (layouts saved for named workspaces landing on workspace 1), via 1787679775.sh. If so, worth a Fixes #12947.

dhh and others added 3 commits October 11, 2026 14:02
Putting it back on each minimize kept a Shelf the user moved where they
put it, but re-added one they had removed. A migration places it once for
existing bars; Super + Alt + M opens the Shelf either way.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A titlebar in the theme's background color ran into the window under it.
It takes the theme's lighter background, the raised surface every theme
defines, and the selection color on themes that make the two the same.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread bin/omarchy-hyprland-window-shelf Resolved
dhh and others added 2 commits October 11, 2026 14:22
A floating workspace is now titlebars with maximize and close, and nothing
else. The Shelf (its bar widget, panel, commands, notes, Super + M and
Super + Alt + M) goes with the minimize button, and the titlebar plugin's
edge snapping is left off, along with the shell's snap preview.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@dhh
dhh force-pushed the floating-desktop branch from 5fb0872 to 3f46918 Compare October 11, 2026 05:23
@dhh dhh changed the title Add titlebars, edge snapping, and a window Shelf to floating workspaces Add a floating mode with titlebars to the workspace layout cycle Oct 11, 2026
dhh and others added 6 commits October 11, 2026 14:34
Chromium names a web app window after its URL, and titles it with the page
title or just the domain. StartupWMClass ties the window to its launcher,
so the titlebar plugin can show the launcher's Name instead: WhatsApp
rather than web.whatsapp.com. New web apps, the shipped ones, and existing
launchers (through a migration) all carry it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The focused workspace's mark is a square for dwindle, a triangle for
scrolling, and a circle for floating, and clicking it cycles the layout
as Super + L does. Both layout toggles ask the bar to read the new mode.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Menu Bar, Battery Percentage, Workspace Layout, Window Gaps, Animations,
and 1-Window Ratio change how the desktop looks rather than switching a
behavior, so they leave Trigger > Toggle for their own menu.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	default/omarchy/omarchy-menu.jsonc
Comment thread migrations/1791696584.sh Resolved
Trigger > Appearance > Workspace Layout sets the layout of every workspace
without one of its own: Tiling, Scrolling, or Floating. A tiled default
is Hyprland's own layout, and a floating one is the floating mode. It
replaces Float All Workspaces, which also overrode and set aside the
layouts workspaces had been given with Super + L.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@dhh
dhh requested a review from outfoxxed October 11, 2026 06:11
Once Super + L gave a workspace a layout of its own, it kept it for good,
so a later change of the default never reached it. Cycling onto the
default layout now forgets the workspace's own instead of saving it.
Without a saved default, the default is Hyprland's own layout, which
the user's looknfeel may have set.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread migrations/1791696584.sh
Comment on lines +24 to +25
CLASS=${class//\\/\\\\} awk '!done && /^Exec=/ { print; print "StartupWMClass=" ENVIRON["CLASS"]; done = 1; next } { print }' "$target" >"$target.omarchy-migrate" &&
cat "$target.omarchy-migrate" >"$target"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Failed writes break existing launchers

The final cat truncates the original launcher before copying the new contents. If the disk fills during that copy, the launcher can be left incomplete and stop working. Stopping the migration does not restore it.

Replace the original only after the new file is fully written, while keeping the existing symlink behavior.

Comment on lines +30 to +31
mkdir -p "$MODES_DIR"
printf 'o.workspace_mode({ default = "%s" })\n' "$1" >"$DEFAULT_FILE"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Failed saves look successful

If creating MODES_DIR or writing DEFAULT_FILE fails, the command still reloads Hyprland and announces the new layout. The requested default was never saved or applied, so users with an unwritable state directory get a success message while their workspaces keep the old default.

Stop on a failed save and report the failure instead.

@greptile-apps

greptile-apps Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Want your agent to iterate on Greptile's feedback? Try greploops.

# Conflicts:
#	default/omarchy/omarchy-menu.jsonc
#	manual/04-navigation.md
#	manual/13-toggles-idle-screensaver.md
@dhh
dhh merged commit 1498718 into quattro Oct 11, 2026
1 check passed
@dhh
dhh deleted the floating-desktop branch October 11, 2026 06:22
omarchybot added a commit to 1deat0r/omarchy that referenced this pull request Oct 11, 2026
quattro's omacom#14482 made omarchy-hyprland-workspace-layout-toggle cycle dwindle, scrolling and floating, with `back` reversing it. Described as dwindle <-> scrolling, an agent restoring tiling from scrolling would float the workspace instead, and the choice persists.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Codex Medium <[email protected]>
omarchybot added a commit to jaderfeijo/omarchy that referenced this pull request Oct 11, 2026
quattro rewrote the toggle into a dwindle, scrolling and floating cycle (omacom#14482) and still reads the workspace from hyprctl activeworkspace, which never reports a special workspace, so SUPER + L with the scratchpad open still reconfigures the workspace under it. The fix now sits on the new script: the open special workspace is read off the focused monitor, addressed by name, and saved as a mode under a loadable key. Its current layout comes from what Hyprland reports, since floating never applies to it: workspace-modes.lua arranges only numbered workspaces, so a special workspace cycles between dwindle and scrolling and skips floating in both directions.

The test is quattro's, with the special workspace cases added on top: the stub puts an unfocused monitor with a scratchpad of its own first, so every case also checks that the focused monitor is the one read.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@emirb emirb added this to the 4.5 milestone Oct 17, 2026
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