add up / down window movement

This commit is contained in:
2026-10-12 09:57:20 -07:00
parent 1e50ecb4f1
commit 3c7c3a37dd
+57 -23
View File
@@ -9,8 +9,8 @@ hl.env("QT_QPA_PLATFORM", "wayland;xcb")
hl.env("QT_QPA_PLATFORMTHEME", "gtk3") hl.env("QT_QPA_PLATFORMTHEME", "gtk3")
hl.env("XCURSOR_SIZE", "24") hl.env("XCURSOR_SIZE", "24")
hl.env("HYPRCURSOR_SIZE", "24") hl.env("HYPRCURSOR_SIZE", "24")
hl.env("DISPLAY", ":0") -- hl.env("DISPLAY", ":0")
hl.env("USE_X11", "false") -- hl.env("USE_X11", "false")
-- monitors -- monitors
hl.monitor({ hl.monitor({
@@ -36,6 +36,8 @@ hl.on("hyprland.start", function ()
hl.exec_cmd("hyprpm reload") -- set up plugins hl.exec_cmd("hyprpm reload") -- set up plugins
hl.exec_cmd("hyprctl setcursor Adwaita 24") -- set cursor to be normal hl.exec_cmd("hyprctl setcursor Adwaita 24") -- set cursor to be normal
hl.exec_cmd("wl-clip-persist --clipboard regular")
hl.exec_cmd("wl-paste --watch cliphist store") hl.exec_cmd("wl-paste --watch cliphist store")
hl.exec_cmd("mako") hl.exec_cmd("mako")
@@ -114,7 +116,9 @@ hl.config({
}, },
scrolling = { scrolling = {
fullscreen_on_one_column = false, focus_fit_method = 1,
explicit_column_widths = "0.5,1",
fullscreen_on_one_column = true,
}, },
}) })
@@ -157,10 +161,17 @@ hl.bind(mainMod .. " + RETURN", hl.dsp.exec_cmd(terminal))
hl.bind(mainMod .. " + D", hl.dsp.exec_cmd(menu)) hl.bind(mainMod .. " + D", hl.dsp.exec_cmd(menu))
hl.bind(mainMod .. " + E", hl.dsp.exec_cmd(fileManager)) hl.bind(mainMod .. " + E", hl.dsp.exec_cmd(fileManager))
hl.bind(mainMod .. " + M", hl.dsp.exec_cmd("command -v hyprshutdown >/dev/null 2>&1 && hyprshutdown || hyprctl dispatch 'hl.dsp.exit()'")) hl.bind(mainMod .. " + M",
hl.dsp.exec_cmd("command -v hyprshutdown >/dev/null 2>&1 && hyprshutdown || hyprctl dispatch 'hl.dsp.exit()'"))
hl.bind(mainMod .. " + SPACE", hl.dsp.window.float({ action = "toggle" })) hl.bind(mainMod .. " + SPACE", hl.dsp.window.float({ action = "toggle" }))
hl.bind(mainMod .. " + F", hl.dsp.window.fullscreen_state({ internal="1", client="1", layout_aware=true, action = "toggle"})) -- toggle maximize in scrolling mode; from https://github.com/hyprwm/Hyprland/discussions/14380
hl.bind(mainMod .. " + F", function()
hl.dispatch(hl.dsp.layout("colresize +conf"))
hl.dispatch(hl.dsp.layout("focus r"))
hl.dispatch(hl.dsp.layout("focus l"))
end
)
hl.bind(mainMod .. " + SHIFT + Q", hl.dsp.window.close()) hl.bind(mainMod .. " + SHIFT + Q", hl.dsp.window.close())
-- change focus -- change focus
@@ -169,26 +180,37 @@ hl.bind(mainMod .. " + RIGHT", hl.dsp.focus({ direction = "right" }))
hl.bind(mainMod .. " + UP", hl.dsp.focus({ direction = "up" })) hl.bind(mainMod .. " + UP", hl.dsp.focus({ direction = "up" }))
hl.bind(mainMod .. " + DOWN", hl.dsp.focus({ direction = "down" })) hl.bind(mainMod .. " + DOWN", hl.dsp.focus({ direction = "down" }))
-- move workspaces local function move_window_relative(delta)
return function()
local ws = hl.get_active_workspace()
if not ws or ws.id < 1 then return end -- ignore special workspaces (negative IDs)
local target = ws.id + delta
if target < 1 or target > 9 then return end
hl.dispatch(hl.dsp.window.move({ workspace = target }))
end
end
-- move windows
hl.bind(mainMod .. " + SHIFT + LEFT", hl.dsp.window.swap({ direction = "left" })) hl.bind(mainMod .. " + SHIFT + LEFT", hl.dsp.window.swap({ direction = "left" }))
hl.bind(mainMod .. " + SHIFT + RIGHT", hl.dsp.window.swap({ direction = "right" })) hl.bind(mainMod .. " + SHIFT + RIGHT", hl.dsp.window.swap({ direction = "right" }))
hl.bind(mainMod .. " + SHIFT + UP", hl.dsp.window.swap({ direction = "up"})) -- moves the window n +- 1 workspaces where n is the current workspace
hl.bind(mainMod .. " + SHIFT + DOWN", hl.dsp.window.swap({ direction = "down"})) hl.bind(mainMod .. " + SHIFT + UP", move_window_relative(-1))
hl.bind(mainMod .. " + SHIFT + DOWN", move_window_relative(1))
-- screenshots -- screenshots
hl.bind("Print", hl.dsp.exec_cmd("grim -g \"$(slurp)\" ~/$(date + '%Y%m%d-%H%M%S').png")) -- dump to home hl.bind("Print", hl.dsp.exec_cmd('grim -g "$(slurp)" - | swappy -f -')) -- opens an interface to choose btwn saving / copying
hl.bind("SUPER + Print", hl.dsp.exec_cmd(
"grim -g \"$(slurp)\" - | wl-copy"
)) -- copy to clipboard
-- hy3 settings -- hy3 settings
local hy3 = hl.plugin.hy3 --local hy3 = hl.plugin.hy3
hl.bind(mainMod .. " + V", hy3.make_group("v")) --hl.bind(mainMod .. " + V", hy3.make_group("v"))
hl.bind(mainMod .. " + H", hy3.make_group("h")) --hl.bind(mainMod .. " + H", hy3.make_group("h"))
hl.bind(mainMod .. " + T", hy3.make_group("tab")) --hl.bind(mainMod .. " + T", hy3.make_group("tab"))
hl.bind(mainMod .. " + CTRL + LEFT", hy3.focus_tab({ direction = "left" })) --hl.bind(mainMod .. " + CTRL + LEFT", hy3.focus_tab({ direction = "left" }))
hl.bind(mainMod .. " + CTRL + RIGHT", hy3.focus_tab({ direction = "right" })) --hl.bind(mainMod .. " + CTRL + RIGHT", hy3.focus_tab({ direction = "right" }))
-- Switch workspaces with mainMod + [0-9] -- Switch workspaces with mainMod + [0-9]
-- Move active window to a workspace with mainMod + SHIFT + [0-9] -- Move active window to a workspace with mainMod + SHIFT + [0-9]
@@ -211,10 +233,14 @@ hl.bind(mainMod .. " + mouse:272", hl.dsp.window.drag(), { mouse = true })
hl.bind(mainMod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true }) hl.bind(mainMod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true })
-- Laptop multimedia keys for volume and LCD brightness -- Laptop multimedia keys for volume and LCD brightness
hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"), { locked = true, repeating = true }) hl.bind("XF86AudioRaiseVolume", hl.dsp.exec_cmd("wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+"),
hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"), { locked = true, repeating = true }) { locked = true, repeating = true })
hl.bind("XF86AudioMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"), { locked = true, repeating = true }) hl.bind("XF86AudioLowerVolume", hl.dsp.exec_cmd("wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"),
hl.bind("XF86AudioMicMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"), { locked = true, repeating = true }) { locked = true, repeating = true })
hl.bind("XF86AudioMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"),
{ locked = true, repeating = true })
hl.bind("XF86AudioMicMute", hl.dsp.exec_cmd("wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"),
{ locked = true, repeating = true })
hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("brightnessctl -e4 -n2 set 5%+"), { locked = true, repeating = true }) hl.bind("XF86MonBrightnessUp", hl.dsp.exec_cmd("brightnessctl -e4 -n2 set 5%+"), { locked = true, repeating = true })
hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd("brightnessctl -e4 -n2 set 5%-"), { locked = true, repeating = true }) hl.bind("XF86MonBrightnessDown", hl.dsp.exec_cmd("brightnessctl -e4 -n2 set 5%-"), { locked = true, repeating = true })
@@ -231,7 +257,7 @@ local suppressMaximizeRule = hl.window_rule({
match = { class = ".*" }, match = { class = ".*" },
suppress_event = "maximize", suppress_event = "maximize",
}) })
suppressMaximizeRule:set_enabled(true) suppressMaximizeRule:set_enabled(false)
hl.window_rule({ hl.window_rule({
-- Fix some dragging issues with XWayland -- Fix some dragging issues with XWayland
@@ -248,4 +274,12 @@ hl.window_rule({
no_focus = true, no_focus = true,
}) })
hl.layer_rule({
name = "slurp",
match = {
title = "*slurp*",
},
blur = false,
})
require("rules") require("rules")