auroraced5016
hypr: dwm-like fullscreen cycling, monitor binds, middle-drag float
+34 −0
2 files changed
- M .config/hypr/source/appearance.lua +3 −0
- M .config/hypr/source/keybinds.lua +31 −0
| @@ -89,5 +89,8 @@ hl.config({ | |||
| 89 | 89 | key_press_enables_dpms = true, | |
| 90 | 90 | ||
| 91 | 91 | vrr = 0, | |
| 92 | + | ||
| 93 | + | -- dwm monocle: focusing another window (super+tab) makes it fullscreen instead of exiting fullscreen | |
| 94 | + | on_focus_under_fullscreen = 1, | |
| 92 | 95 | }, | |
| 93 | 96 | }) | |
| @@ -79,6 +79,29 @@ for i = 1, smw.get_amount_of_workspaces() do | |||
| 79 | 79 | hl.bind(mainMod .. " + SHIFT +" .. n, smw.move_to_workspace_silent(n)) | |
| 80 | 80 | end | |
| 81 | 81 | ||
| 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 | + | ||
| 82 | 105 | -- Example special workspace (scratchpad) | |
| 83 | 106 | hl.bind(mainMod .. " + S", hl.dsp.workspace.toggle_special("magic")) | |
| 84 | 107 | 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" })) | |||
| 137 | 160 | hl.bind(mainMod .. " + mouse:272", hl.dsp.window.drag(), { mouse = true }) | |
| 138 | 161 | hl.bind(mainMod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true }) | |
| 139 | 162 | ||
| 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 | + | ||
| 140 | 171 | -- Laptop multimedia keys for volume and LCD brightness (brightness goes through aurora for the OSD; it runs ~/.local/bin/brictl) | |
| 141 | 172 | hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"), { locked = true, repeating = true }) | |
| 142 | 173 | hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), { locked = true, repeating = true }) | |