From d8f5d10f05e2779d5e60d2f86951146bef04688a Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Tue, 13 Oct 2026 18:43:54 -0400 Subject: [PATCH] feat(config): add niri-style keybindings and layout adjustments --- dot_config/hypr/bindings.lua | 10 ++++++++++ dot_config/hypr/hyprland.lua | 4 ++-- dot_config/hypr/input.lua | 24 +++++++++++++++++------- dot_config/hypr/looknfeel.lua | 19 +++++++++++++++---- 4 files changed, 44 insertions(+), 13 deletions(-) diff --git a/dot_config/hypr/bindings.lua b/dot_config/hypr/bindings.lua index b9cd7dc..bb5f2b4 100644 --- a/dot_config/hypr/bindings.lua +++ b/dot_config/hypr/bindings.lua @@ -314,3 +314,13 @@ o.bind("SUPER + ALT + SHIFT + F", "File manager (cwd)", { launch = 'flea --gui " -- flea --picker: begin. Written by `flea --picker`; `flea --picker off` removes the block whole. o.window("com.thisisgm.flea.picker", { tag = "+floating-window" }) -- flea --picker: end. + +-- niri-style: SUPER + F maximizes (Omarchy's SUPER + ALT + F "Full width"), +-- SUPER + SHIFT + F goes true fullscreen. Kept below the flea blocks so it +-- wins over the file-manager bind `flea --default` writes onto +-- SUPER + SHIFT + F; flea stays on SUPER + ALT + SHIFT + F, Nautilus on +-- SUPER + CTRL + ALT + F. +hl.unbind("SUPER + F") -- was: full screen +o.bind("SUPER + F", "Maximize", hl.dsp.window.fullscreen({ mode = "maximized" })) +hl.unbind("SUPER + SHIFT + F") -- was: file manager (flea --gui) +o.bind("SUPER + SHIFT + F", "Full screen", hl.dsp.window.fullscreen({ mode = "fullscreen" })) diff --git a/dot_config/hypr/hyprland.lua b/dot_config/hypr/hyprland.lua index 275a31c..b23d075 100644 --- a/dot_config/hypr/hyprland.lua +++ b/dot_config/hypr/hyprland.lua @@ -55,8 +55,8 @@ o.window([[^tldraw-offline$]], { workspace = "5", fullscreen = true }) -- Scratch workspaces, toggled by ~/.local/bin/omarchy-toggle-scratch, which -- also starts any resident that is missing and picks the monitor. Pinning -- the residents here means they land on their workspace no matter who starts --- them; "silent" leaves the reveal to the script. Under the master layout the --- first window to appear takes the master slot; the rest stack beside it. +-- them; "silent" leaves the reveal to the script. Under the scrolling layout +-- each resident gets its own column, in the order they appear. -- -- SUPER + A / SUPER + CTRL + S: Tern; SUPER + SHIFT + A: Claude Desktop. -- Each alone on its own workspace, Studio Display. Tern has no per-window diff --git a/dot_config/hypr/input.lua b/dot_config/hypr/input.lua index cbbbc29..e7a17dc 100644 --- a/dot_config/hypr/input.lua +++ b/dot_config/hypr/input.lua @@ -18,9 +18,25 @@ hl.config({ input = { repeat_delay = 250, repeat_rate = 50, + + -- niri has no focus-follows-mouse: hovering gives a window pointer focus + -- (scroll goes there) but keyboard focus moves only on click. Also keeps + -- the scrolling tape from jumping when the cursor brushes a neighbour. + follow_mouse = 2, + + -- niri: touchpad { natural-scroll; tap; }. Tap-to-click is libinput's + -- default already. + touchpad = { + natural_scroll = true, + }, }, }) +-- niri's built-in touchpad gestures: three fingers sideways scroll the tape, +-- up/down switch workspace. +hl.gesture({ fingers = 3, direction = "horizontal", action = "scroll_move" }) +hl.gesture({ fingers = 3, direction = "vertical", action = "workspace" }) + -- Keyboard layout and options. -- See https://wiki.hypr.land/Configuring/Basics/Variables/#input -- hl.config({ @@ -68,13 +84,7 @@ hl.config({ -- o.window("(Alacritty|kitty|foot)", { scroll_touchpad = 1.5 }) -- o.window("com.mitchellh.ghostty", { scroll_touchpad = 0.2 }) --- Enable touchpad gestures for changing workspaces. --- See https://wiki.hypr.land/Configuring/Advanced-and-Cool/Gestures/ --- hl.gesture({ fingers = 3, direction = "horizontal", action = "workspace" }) - --- Enable touchpad gestures for moving focus (helpful on scrolling layout). --- hl.gesture({ fingers = 3, direction = "left", action = function() hl.dispatch(hl.dsp.focus({ direction = "l" })) end }) --- hl.gesture({ fingers = 3, direction = "right", action = function() hl.dispatch(hl.dsp.focus({ direction = "r" })) end }) +-- Touchpad gestures live in the override block at the top of this file. -- Tablets / pens. -- Hyprland maps a tablet across the *whole* monitor layout by default diff --git a/dot_config/hypr/looknfeel.lua b/dot_config/hypr/looknfeel.lua index 37f701c..b835fe0 100644 --- a/dot_config/hypr/looknfeel.lua +++ b/dot_config/hypr/looknfeel.lua @@ -22,10 +22,18 @@ -- opt every window out again except the terminals below. hl.config({ general = { - -- Master instead of Omarchy's dwindle. Per-workspace layouts saved by - -- omarchy-hyprland-workspace-layout-toggle (~/.local/state/omarchy/ - -- workspace-layouts/*.lua) still win for the workspaces they name. - layout = "master", + -- Scrolling (niri-style tape) instead of Omarchy's dwindle. Per-workspace + -- layouts saved by omarchy-hyprland-workspace-layout-toggle (SUPER + W; + -- ~/.local/state/omarchy/workspace-layouts/*.lua) still win for the + -- workspaces they name. + layout = "scrolling", + + -- niri's layout `gaps` is unset, so its default 16 applies: 16 logical px + -- between windows and at the screen edge. Hyprland pads each side of a + -- window by gaps_in, so two neighbours sit 2 * gaps_in apart. + -- ~/.local/bin/omarchy-pip and omarchy-smart-move inset by gaps_out too. + gaps_in = 8, + gaps_out = 16, }, decoration = { @@ -135,5 +143,8 @@ hl.config({ focus_fit_method = 1, -- niri keeps a lone column at its own width instead of filling the screen. fullscreen_on_one_column = false, + -- niri stops at the first/last column instead of wrapping around. + wrap_focus = false, + wrap_swapcol = false, }, })