Fix config

This commit is contained in:
2026-08-02 18:31:59 +02:00
parent a101a8b58d
commit 601b3be38c
+34 -34
View File
@@ -1,3 +1,10 @@
-- ============================================================
-- Hyprland Lua config (converted from hyprlang .conf, v0.55+)
-- Converted by Claude — please review the TODO-flagged lines,
-- the Lua API surface is new and some dispatcher names/shapes
-- are best-effort based on current docs/community examples.
-- ============================================================
local mainMod = "SUPER"
--------------------
@@ -17,7 +24,7 @@ hl.env("XCURSOR_SIZE", "24")
-- Auto start
--------------------
hl.on("hyprland.start", function()
-- Slow app launch
-- Slow app launch fix
hl.dispatch(hl.dsp.exec_cmd("systemctl --user import-environment"))
hl.dispatch(hl.dsp.exec_cmd("hash dbus-update-activation-environment 2>/dev/null"))
hl.dispatch(hl.dsp.exec_cmd("dbus-update-activation-environment --systemd"))
@@ -40,7 +47,6 @@ hl.on("hyprland.start", function()
hl.dispatch(hl.dsp.exec_cmd("xwaylandvideobridge"))
end)
--------------------------
-- General configurations
--------------------------
@@ -141,26 +147,21 @@ hl.device({
--------------------
-- Animations
--------------------
-- TODO: bezier/animation shape is one of the least-standardized
-- parts of the new API across the examples I found. hl.curve() is
-- confirmed for bezier curves; the `animation =` line itself may
-- need to be hl.config({ animations = { animation = {...} } }) on
-- your build — check `hyprctl` / the wiki's Animations page.
hl.curve("overshot", { type = "bezier", points = { { 0.13, 0.99 }, { 0.29, 1.1 } } })
hl.config({
animations = {
enabled = true,
animation = {
{ "windows", 1, 4, "overshot", "slide" },
{ "windowsOut", 1, 5, "default", "popin 80%" },
{ "border", 1, 5, "default" },
{ "fade", 1, 8, "default" },
{ "workspaces", 1, 6, "overshot", "slide" },
},
enabled = true, -- master on/off switch
},
})
hl.animation({ leaf = "windows", enabled = true, speed = 4, bezier = "overshot", style = "slide" })
hl.animation({ leaf = "windowsOut", enabled = true, speed = 5, bezier = "default", style = "popin 80%" })
hl.animation({ leaf = "border", enabled = true, speed = 5, bezier = "default" })
hl.animation({ leaf = "fade", enabled = true, speed = 8, bezier = "default" })
hl.animation({ leaf = "workspaces", enabled = true, speed = 6, bezier = "overshot", style = "slide" })
--------------------
-- Bindings
@@ -226,10 +227,10 @@ hl.bind(mainMod .. " + CTRL + SHIFT + ALT + R",
hl.dsp.exec_cmd("killall -SIGUSR2 waybar && hyprctl reload && notify-send \"Waybar and Hyprland reloaded\""))
-- Move focus
hl.bind(mainMod .. " + left", hl.dsp.window.focus({ direction = "l" }))
hl.bind(mainMod .. " + right", hl.dsp.window.focus({ direction = "r" }))
hl.bind(mainMod .. " + up", hl.dsp.window.focus({ direction = "u" }))
hl.bind(mainMod .. " + down", hl.dsp.window.focus({ direction = "d" }))
hl.bind(mainMod .. " + left", hl.dsp.focus({ direction = "left" }))
hl.bind(mainMod .. " + right", hl.dsp.focus({ direction = "right" }))
hl.bind(mainMod .. " + up", hl.dsp.focus({ direction = "up" }))
hl.bind(mainMod .. " + down", hl.dsp.focus({ direction = "down" }))
hl.bind("ALT + Tab", function()
hl.dispatch(hl.dsp.window.cycle_next())
@@ -247,7 +248,7 @@ hl.bind(mainMod .. " + ALT + right", hl.dsp.window.swap({ direction = "r" }))
hl.bind(mainMod .. " + ALT + up", hl.dsp.window.swap({ direction = "u" }))
hl.bind(mainMod .. " + ALT + down", hl.dsp.window.swap({ direction = "d" }))
hl.bind(mainMod .. " + D", hl.dsp.layout_msg("togglesplit")) -- TODO: verify layoutmsg dispatcher name
hl.bind(mainMod .. " + D", hl.dsp.layout("togglesplit")) -- dwindle only
-- Window resize
hl.bind(mainMod .. " + CTRL + SHIFT + left", hl.dsp.window.resize({ x = -15, y = 0, relative = true }),
@@ -260,28 +261,28 @@ hl.bind(mainMod .. " + CTRL + SHIFT + down", hl.dsp.window.resize({ x = 0, y = 1
{ repeating = true })
-- Windows mouse interaction
hl.bind(mainMod .. " + mouse:272", hl.dsp.window.move())
hl.bind(mainMod .. " + mouse:273", hl.dsp.window.resize())
hl.bind(mainMod .. " + mouse:272", hl.dsp.window.drag(), { mouse = true })
hl.bind(mainMod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true })
-- Switch workspaces
for i = 1, 9 do
hl.bind(mainMod .. " + " .. tostring(i), hl.dsp.workspace.change(tostring(i)))
hl.bind(mainMod .. " + " .. tostring(i), hl.dsp.focus({ workspace = i }))
end
hl.bind(mainMod .. " + 0", hl.dsp.workspace.change("10"))
hl.bind(mainMod .. " + 0", hl.dsp.focus({ workspace = 10 }))
hl.bind("CTRL + ALT + right", hl.dsp.workspace.change("e+1"))
hl.bind("CTRL + ALT + left", hl.dsp.workspace.change("e-1"))
hl.bind("CTRL + ALT + right", hl.dsp.focus({ workspace = "e+1" }))
hl.bind("CTRL + ALT + left", hl.dsp.focus({ workspace = "e-1" }))
hl.bind(mainMod .. " + mouse_down", hl.dsp.workspace.change("e+1"))
hl.bind(mainMod .. " + mouse_up", hl.dsp.workspace.change("e-1"))
hl.bind(mainMod .. " + mouse_down", hl.dsp.focus({ workspace = "e+1" }))
hl.bind(mainMod .. " + mouse_up", hl.dsp.focus({ workspace = "e-1" }))
-- Window workspace movement
for i = 1, 9 do
hl.bind(mainMod .. " + CTRL + " .. tostring(i), hl.dsp.window.move_to_workspace(tostring(i)))
hl.bind(mainMod .. " + CTRL + " .. tostring(i), hl.dsp.window.move({ workspace = i }))
end
hl.bind(mainMod .. " + CTRL + 0", hl.dsp.window.move_to_workspace("10"))
hl.bind(mainMod .. " + CTRL + left", hl.dsp.window.move_to_workspace("-1"))
hl.bind(mainMod .. " + CTRL + right", hl.dsp.window.move_to_workspace("+1"))
hl.bind(mainMod .. " + CTRL + 0", hl.dsp.window.move({ workspace = 10 }))
hl.bind(mainMod .. " + CTRL + left", hl.dsp.window.move({ workspace = "-1" }))
hl.bind(mainMod .. " + CTRL + right", hl.dsp.window.move({ workspace = "+1" }))
-- binds {
-- workspace_back_and_forth = true,
@@ -321,8 +322,7 @@ hl.window_rule({ float = true, match = { class = "^(Matplotlib)$" } })
-- XWayland workaround
hl.window_rule({
opacity = 0.0,
override = true,
opacity = "0.0 override",
no_anim = true,
no_initial_focus = true,
max_size = "1 1",