Skip to content

cjber/hyprview

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hyprview

hyprview

A workspace overview for Hyprland 0.55 or newer. Distributed as a Lua module; no C++ plugin or hyprpm involved.

Pressing the bind floats every tiled window on the active workspace into a grid. Pressing again unfloats them, and the scrolling layout puts the columns back where they were.

Why a Lua module instead of a plugin

Hyprland 0.55 moved configuration from hyprlang to Lua. Plugin dispatchers are not exposed through the Lua bridge: builds of hyprexpo, hyprexpo-plus, and the various hyprland-scroll-overview forks load successfully, but their :expo and :overview dispatchers cannot be invoked from Lua, hyprctl, or the raw IPC socket. hyprview avoids the gap by calling only the stock hl.dsp.window.* dispatchers.

The grid uses logical (post-transform) coordinates, so it works on rotated monitors. On exit, the unfloating walks the original column order so the scrolling layout restores columns to their starting positions.

Install

Clone into Hyprland's Lua module path:

git clone https://github.com/cjber/hyprview ~/.config/hypr/hyprview

Then in ~/.config/hypr/hyprland.lua:

require("hyprview").setup({
    bind    = "SUPER + Tab",
    padding = 30,
})

Reload with hyprctl reload. Press the bind to toggle.

Options

key type default description
bind string "SUPER + Tab" Keybind passed to hl.bind. Set to false to skip binding and call toggle() yourself.
padding int 30 Pixel gap between grid cells and screen edges (logical px).
cols function function(n) return ceil(sqrt(n)) end Grid column count for n tiled windows. Override for fixed shapes, e.g. function() return 3 end.
center_on_exit bool false After exit, briefly switch scrolling.focus_fit_method to 0 (center) so the focused column lands in the middle of the viewport instead of the layout's default fit.
restore_focus_fit_method int 1 Value to restore scrolling.focus_fit_method to after centering. Set to whatever the rest of your config uses.
restore_delay_ms int 80 Delay before the restore fires (ms).

API

local v = require("hyprview")
v.setup(opts)   -- merge opts, register bind
v.toggle()      -- enter or exit
v.enter()       -- enter only (no-op if active)
v.exit()        -- exit only (no-op if inactive)
v.is_active()   -- bool

Caveats

  • Windows are floated and resized while the overview is active. They render at native scale inside the grid cell. Hyprland does not expose per-window scale, so this is not compositor-level zoom.
  • Floating windows on the active workspace are left alone. The grid only includes tiled windows.
  • Windows opened while the overview is active tile normally and are not added to the grid until the next toggle.
  • Tested on Hyprland 0.55.2 with the native scrolling layout, on a horizontal monitor and a rotated (transform 1) vertical monitor.

License

MIT