fix(hypr): adjust monitor positions, add float limit, new keybindings

- Reorder monitor positions (Stargate/ARZOPA to auto-down, MSI to auto-left)
- Add toggle_float_with_limit function that caps floating windows at 80%
- Add keybindings for Obsidian today and pi tui
- Add window rules for terminal-pi and quicknotes (floating)
- Update ostt-popup to fixed size/position
This commit is contained in:
2026-08-19 14:42:03 -04:00
parent c53a58a55e
commit 77b2db55ec
+57 -11
View File
@@ -38,8 +38,8 @@ hl.monitor({
hl.monitor({ output = "desc:Lenovo Group Limited L15 U133R0A2", mode = "preferred", position = "auto-left", scale = 1 }) hl.monitor({ output = "desc:Lenovo Group Limited L15 U133R0A2", mode = "preferred", position = "auto-left", scale = 1 })
hl.monitor({ output = "desc:Lenovo Group Limited M15 V30F2A15", mode = "preferred", position = "auto-left", scale = 1 }) hl.monitor({ output = "desc:Lenovo Group Limited M15 V30F2A15", mode = "preferred", position = "auto-left", scale = 1 })
hl.monitor({ output = "desc:Proteon TYPE-C 8R33926O00QS", mode = "preferred", position = "auto-right", scale = "1.0" }) hl.monitor({ output = "desc:Proteon TYPE-C 8R33926O00QS", mode = "preferred", position = "auto-right", scale = "1.0" })
hl.monitor({ output = "desc:Stargate Technology TYPE-C", mode = "preferred", position = "auto-right", scale = "1.0" }) hl.monitor({ output = "desc:Stargate Technology TYPE-C", mode = "preferred", position = "auto-down", scale = "1.0" })
hl.monitor({ output = "desc:GWD ARZOPA 000000000000", mode = "preferred", position = "auto-left", scale = "1.0" }) hl.monitor({ output = "desc:GWD ARZOPA 000000000000", mode = "preferred", position = "auto-down", scale = "1.0" })
hl.monitor({ output = "desc:BNQ BenQ EX3203R 7CL00509019", mode = "preferred", position = "auto", scale = 1 }) hl.monitor({ output = "desc:BNQ BenQ EX3203R 7CL00509019", mode = "preferred", position = "auto", scale = 1 })
hl.monitor({ output = "desc:BNQ BenQ EX3501R N4M05650019", mode = "preferred", position = "auto-right", scale = "1.0" }) hl.monitor({ output = "desc:BNQ BenQ EX3501R N4M05650019", mode = "preferred", position = "auto-right", scale = "1.0" })
hl.monitor({ hl.monitor({
@@ -52,7 +52,7 @@ hl.monitor({
hl.monitor({ hl.monitor({
output = "desc:Microstep MSI MAG342CQR DB6H252300057", output = "desc:Microstep MSI MAG342CQR DB6H252300057",
mode = "preferred", mode = "preferred",
position = "auto-right", position = "auto-left",
scale = scale =
"1.0" "1.0"
}) })
@@ -197,7 +197,7 @@ hl.animation({ leaf = "fade", enabled = true, speed = 3, bezier = "almostLinear"
-- local terminal = "ghostty -e" -- local terminal = "ghostty -e"
local terminal = "foot" local terminal = "foot"
local notify_cmd = "notify-send" local _notify_cmd = "notify-send"
local browser = "gtk-launch firefox.desktop" local browser = "gtk-launch firefox.desktop"
local webapp = "chromium --new-window --ozone-platform=wayland --app=" local webapp = "chromium --new-window --ozone-platform=wayland --app="
local music = "gtk-launch spotify.desktop" local music = "gtk-launch spotify.desktop"
@@ -318,13 +318,44 @@ function toggle_master()
hl.dispatch(hl.dsp.layout("mfact exact " .. mfact)) hl.dispatch(hl.dsp.layout("mfact exact " .. mfact))
end end
function toggle_float_with_limit()
local win = hl.get_active_window()
if win == nil then
return
end
local was_floating = win.floating
hl.dispatch(hl.dsp.window.float({ action = "toggle" }))
if was_floating then
return
end
win = hl.get_active_window()
local mon = win and win.monitor and hl.get_monitor(win.monitor) or hl.get_active_monitor()
if mon == nil or mon.size == nil or win == nil or win.size == nil then
return
end
local max_width = math.floor(mon.size.width * 0.8)
local max_height = math.floor(mon.size.height * 0.8)
local scale = math.min(1, max_width / win.size.width, max_height / win.size.height)
if scale < 1 then
hl.dispatch(hl.dsp.window.resize({
x = math.floor(win.size.width * scale),
y = math.floor(win.size.height * scale),
relative = false,
}))
end
end
hl.bind(LEADER .. "SHIFT + return", hl.dsp.exec_cmd("gtk-launch herdr.desktop"), { description = "Open herdr terminal" }) hl.bind(LEADER .. "SHIFT + return", hl.dsp.exec_cmd("gtk-launch herdr.desktop"), { description = "Open herdr terminal" })
hl.bind(LEADER .. "return", hl.dsp.exec_cmd("gtk-launch tmux.desktop"), { description = "Open tmux terminal" }) hl.bind(LEADER .. "return", hl.dsp.exec_cmd("gtk-launch tmux.desktop"), { description = "Open tmux terminal" })
hl.bind(LEADER .. "N", hl.dsp.exec_cmd(terminal .. " -a quicknotes -e nvim +'Obsidian today'"),
{ description = "Open Obsidian today in a centered floating window" })
hl.bind(LEADER .. "B", hl.dsp.exec_raw(browser), { description = "Open browser" }) hl.bind(LEADER .. "B", hl.dsp.exec_raw(browser), { description = "Open browser" })
hl.bind(LEADER .. "T", hl.dsp.exec_raw(terminal .. " -e btop"), { description = "Open system monitor" })
hl.bind(LEADER .. "S", hl.dsp.exec_raw("ostt launch --paste"), { description = "Open ostt" }) hl.bind(LEADER .. "S", hl.dsp.exec_raw("ostt launch --paste"), { description = "Open ostt" })
hl.bind(LEADER .. "I", function() sysinfo() end, { description = "Show system info" }) hl.bind(LEADER .. "I", sysinfo, { description = "Show system info" })
-- Open rofi on first press, closes it on second -- Open rofi on first press, closes it on second
hl.bind(LEADER .. "Space", hl.dsp.exec_raw("rofi -show combi --modes combi"), hl.bind(LEADER .. "Space", hl.dsp.exec_raw("rofi -show combi --modes combi"),
@@ -340,6 +371,7 @@ hl.bind(LEADER .. "slash",
{ release = true, description = "Open rofi-pass" } { release = true, description = "Open rofi-pass" }
) )
hl.bind(HYPR .. "P", hl.dsp.exec_cmd("gtk-launch pi.desktop"), { description = "Open pi tui" })
hl.bind(HYPR .. "V", hl.dsp.exec_cmd("pavucontrol"), { description = "Volume control" }) hl.bind(HYPR .. "V", hl.dsp.exec_cmd("pavucontrol"), { description = "Volume control" })
hl.bind(HYPR .. "B", hl.dsp.exec_cmd("blueberry"), { description = "Bluetooth manager" }) hl.bind(HYPR .. "B", hl.dsp.exec_cmd("blueberry"), { description = "Bluetooth manager" })
@@ -430,7 +462,9 @@ hl.bind(LEADER .. "CTRL + F", hl.dsp.window.fullscreen_state({ internal = 2, cli
{ description = "Window: Toggle fullscreen state 2" }) { description = "Window: Toggle fullscreen state 2" })
hl.bind(LEADER .. "ALT + F", hl.dsp.window.fullscreen_state({ internal = 0, client = 2, action = "toggle" }), hl.bind(LEADER .. "ALT + F", hl.dsp.window.fullscreen_state({ internal = 0, client = 2, action = "toggle" }),
{ description = "Window: Toggle fullscreen state 2" }) { description = "Window: Toggle fullscreen state 2" })
hl.bind(LEADER .. "SHIFT + F", hl.dsp.window.float({ action = "toggle" }), { description = "Window: Toggle floating" })
hl.bind(LEADER .. "T", toggle_float_with_limit,
{ description = "Window: Toggle floating/tiling (max 80%)" })
hl.bind(LEADER .. "P", hl.dsp.window.pseudo(), { description = "Window: Toggle pseudo tiling" }) hl.bind(LEADER .. "P", hl.dsp.window.pseudo(), { description = "Window: Toggle pseudo tiling" })
@@ -462,9 +496,7 @@ hl.bind(LEADER .. "ALT + Tab", hl.dsp.focus({ workspace = "previous", on_current
{ description = "Window: Focus previous in workspace" }) { description = "Window: Focus previous in workspace" })
-- arrange split ratio -- arrange split ratio
hl.bind(LEADER .. "X", function() hl.bind(LEADER .. "X", toggle_master, { description = "Layout: Toggle master size" })
toggle_master()
end)
-- hl.bind(LEADER .. "equal", hl.dsp.layout("mfact exact 0.5")) -- hl.bind(LEADER .. "equal", hl.dsp.layout("mfact exact 0.5"))
hl.bind(LEADER .. "M", hl.dsp.layout("swapwithmaster")) hl.bind(LEADER .. "M", hl.dsp.layout("swapwithmaster"))
@@ -651,10 +683,23 @@ hl.window_rule({
"+floating-window" "+floating-window"
}) })
hl.window_rule({
match = { class = "terminal-pi" },
tag = "+floating-window"
})
hl.window_rule({
match = { class = "quicknotes" },
tag = "+floating-window"
})
hl.window_rule({ hl.window_rule({
name = "ostt floating windows", name = "ostt floating windows",
match = { class = "ostt-popup" }, match = { class = "ostt-popup" },
tag = "+floating-window" float = true,
no_anim = true,
move = { 10, 10 },
size = { 320, 240 },
}) })
hl.window_rule({ hl.window_rule({
@@ -685,6 +730,7 @@ hl.window_rule({
no_focus = true, no_focus = true,
}) })
hl.window_rule({ match = { tag = "floating-window" }, float = true, center = true, size = { "monitor_w/2", "monitor_h/2" } }) hl.window_rule({ match = { tag = "floating-window" }, float = true, center = true, size = { "monitor_w/2", "monitor_h/2" } })
hl.window_rule({ match = { class = "(rofi|wofi)" }, tag = "+user-menu" }) hl.window_rule({ match = { class = "(rofi|wofi)" }, tag = "+user-menu" })