Krolyxon
Commit ced5016

Branches

Refs →

auroraced5016

hypr: dwm-like fullscreen cycling, monitor binds, middle-drag float

Author
krolyxon
Date
2026-10-19 23:10 +0530
Parent
fb86a84
Commit
ced5016a627e528866ecc03beb91175af75975d5

+34 −0

2 files changed

  1. M .config/hypr/source/appearance.lua +3 −0
  2. M .config/hypr/source/keybinds.lua +31 −0
M .config/hypr/source/appearance.lua View
@@ -89,5 +89,8 @@ hl.config({
8989 key_press_enables_dpms = true,
9090
9191 vrr = 0,
92+
93+ -- dwm monocle: focusing another window (super+tab) makes it fullscreen instead of exiting fullscreen
94+ on_focus_under_fullscreen = 1,
9295 },
9396 })
M .config/hypr/source/keybinds.lua View
@@ -79,6 +79,29 @@ for i = 1, smw.get_amount_of_workspaces() do
7979 hl.bind(mainMod .. " + SHIFT +" .. n, smw.move_to_workspace_silent(n))
8080 end
8181
82+-- dwm focusmon/tagmon: focus the previous/next monitor, or send the window to its visible workspace (focus stays)
83+local function tagmon(dir)
84+ return function()
85+ local mons = hl.get_monitors()
86+ local cur = hl.get_active_monitor()
87+ if #mons < 2 or not cur then return end
88+ table.sort(mons, function(a, b) return a.id < b.id end)
89+ for i, m in ipairs(mons) do
90+ if m.id == cur.id then
91+ local target = mons[(i - 1 + dir) % #mons + 1]
92+ if target.active_workspace then
93+ hl.dispatch(hl.dsp.window.move({ workspace = tostring(target.active_workspace.id), follow = false }))
94+ end
95+ return
96+ end
97+ end
98+ end
99+end
100+hl.bind(mainMod .. " + Left", hl.dsp.focus({ monitor = "-1" }))
101+hl.bind(mainMod .. " + Right", hl.dsp.focus({ monitor = "+1" }))
102+hl.bind(mainMod .. " + SHIFT + Left", tagmon(-1))
103+hl.bind(mainMod .. " + SHIFT + Right", tagmon(1))
104+
82105 -- Example special workspace (scratchpad)
83106 hl.bind(mainMod .. " + S", hl.dsp.workspace.toggle_special("magic"))
84107 hl.bind(mainMod .. " + SHIFT + S", hl.dsp.window.move({ workspace = "special:magic" }))
@@ -137,6 +160,14 @@ hl.bind(mainMod .. " + mouse_up", hl.dsp.focus({ workspace = "e-1" }))
137160 hl.bind(mainMod .. " + mouse:272", hl.dsp.window.drag(), { mouse = true })
138161 hl.bind(mainMod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true })
139162
163+-- mainMod + MMB drag: float a tiled window and move it, like dwm
164+-- (follow_mouse = 1, so the active window is the one under the cursor)
165+hl.bind(mainMod .. " + mouse:274", function()
166+ local w = hl.get_active_window()
167+ if w and not w.floating then hl.dispatch(hl.dsp.window.float({ action = "set" })) end
168+end, { non_consuming = true })
169+hl.bind(mainMod .. " + mouse:274", hl.dsp.window.drag(), { mouse = true })
170+
140171 -- Laptop multimedia keys for volume and LCD brightness (brightness goes through aurora for the OSD; it runs ~/.local/bin/brictl)
141172 hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"), { locked = true, repeating = true })
142173 hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), { locked = true, repeating = true })