Skip to content

Add V (toggle horizontal/vertical layout) and X (swap monitor order) keys - #95

Open
KeepThisTicket wants to merge 4 commits into
erans:mainfrom
KeepThisTicket:orientation-swap-keys
Open

KeepThisTicket wants to merge 4 commits into
erans:mainfrom
KeepThisTicket:orientation-swap-keys

Conversation

@KeepThisTicket

Copy link
Copy Markdown

What

Two keyboard shortcuts in the layout view for quickly rearranging a multi-monitor setup:

  • V – toggle the active monitors between a side-by-side row and a stacked column. Order is kept (left→right becomes top→bottom), each monitor is centered on the cross axis, and the layout stays anchored at its top-left corner.
  • X – swap the monitor order along the current axis (left ↔ right in a row, top ↔ bottom in a column).

Both only rearrange the layout in the TUI, like moving a monitor with the arrow keys; nothing reaches Hyprland until A (apply) or S (save). Inactive and mirrored monitors are left alone, and with fewer than two active monitors the keys just show a status message.

Why

Switching a laptop + external display between "next to" and "above" (and choosing which one is on top) currently means dragging each monitor into place by hand. With these keys it's V, optionally X, then A.

Changes

  • models.go: toggleOrientation() and swapMonitorOrder(), sharing one arrangeMonitors() helper that detects the current orientation from the spread of monitor centers and respects rotation/scale via getEffectiveDimensions.
  • update.go: V and X key handlers.
  • view.go, README.md: help screen, footer, and key table.
  • orientation_test.go: round-trip toggle, rotated monitors, swap in both orientations, <2 monitors, and a check that V/X don't trigger an apply.

go test ./..., gofmt, and go vet pass.

Testing

I've only tested this on real hardware with 2 monitors (laptop panel + one external display). The logic is written for any number of active monitors (they're laid out in a single row/column in their current order), but I haven't tried it with 3 or more, so feedback from anyone with a bigger setup would be welcome.

🤖 Generated with Claude Code

KeepThisTicket and others added 4 commits November 7, 2026 11:23
Pressing V rearranges active, non-mirrored monitors from a side-by-side
row into a centered stacked column (or back), preserving their order,
and applies the result live. Z reverts, S persists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reverses the active monitors along the current layout axis (left<->right
in a row, top<->bottom in a column) and applies it live. Shares the
layout code with the V orientation toggle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The orientation toggle and monitor swap now only rearrange the layout in
the TUI, like moving a monitor with the arrow keys. Changes reach
Hyprland when A (apply) or S (save) is pressed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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