Commit Graph

8 Commits (10a5fbb33b677faad6453b09929d7a724997f41f)

Author SHA1 Message Date
Amir Alexander Abdelbaki 10a5fbb33b feat(monitor-manager): write live config and resolve snap overlaps
Target ~/.config/hypr/usr/monitors.lua (the config Hyprland actually
loads) so `hyprctl reload` applies layouts immediately; the Dotfiles
repo copy stays the deploy source and is no longer written.

Add overlap geometry helpers and integrate them into the apply flow:
- block moves that would drive a monitor into a neighbor (TUI coords)
- snap positions to the MOVE_STEP_FINE grid to avoid frozen digits
- auto-resolve snap-induced collisions by re-reading the live layout
  and nudging the moved monitor clear, up to MAX_RESOLVE_ITERS
- warn on residual overlap after apply and after save/reload

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 16:00:52 +02:00
Amir Alexander Abdelbaki 7016388210 fix(monitor-manager): account for scale when computing logical monitor size
logical_width/height now divide physical pixels by scale so the canvas
correctly represents the compositor's coordinate space (e.g. 3840px @1.5x
is 2560 logical px wide, not 3840).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 08:34:34 +02:00
Amir Alexander Abdelbaki 3388910bb0 feat(hyprlua): hyprctl reload after saving monitor config
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 09:56:19 +02:00
Amir Alexander Abdelbaki fc90432d22 fix(hyprlua): change scale keybinds from T/G to t/g
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 09:54:38 +02:00
Amir Alexander Abdelbaki 08e4e583a3 feat(hyprlua): snap T/G scale to valid Hyprland steps for current resolution
Replaces fixed 0.25 increments with mathematically valid scales p/q
(lowest terms, q≤6) where both width/s and height/s are integers.
For 1920x1200 this gives 25 steps including 2.4, matching what
Hyprland actually applies — no more mismatch between TUI display
and live value.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 09:52:45 +02:00
Amir Alexander Abdelbaki b28ee57ebf fix(hyprlua): normalize hyprctl mirrorOf "none" to prevent monitor reset
hyprctl returns mirrorOf:"none" (string) for non-mirrored monitors.
Python treated it as truthy, causing apply_monitor to always emit a
mirror command, resetting resolution and scale on every keypress.
Also restores monitors.lua with correct mode/scale/transform fields.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 09:39:10 +02:00
Amir Alexander Abdelbaki 280a41133f feat(hyprlua): add T/G scale adjust and Enter save+quit to monitor-manager
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 09:15:44 +02:00
Amir Alexander Abdelbaki 199f7296a9 feat(hyprlua): add WYSIWYG monitor manager TUI
Python curses TUI for managing Hyprland monitors interactively:
- Canvas shows monitors as boxes at their real relative positions
- Tab/Shift+Tab to cycle selection; hjkl/HJKL to move (50/10 px)
- u/i to rotate CCW/CW; n/N to cycle display modes live
- m to mirror (pick target with Tab, confirm with Enter)
- s saves to hypr/usr/monitors.lua atomically
- Scale cached and only recomputed on resize or viewport overflow
- Bound to Super+Shift+M as a centered-L floating kitty popup

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-23 09:03:25 +02:00