hyprland migration from hyprlang to lua

This commit is contained in:
Thomas
2026-05-13 15:57:05 +02:00
parent 6c4519b70a
commit 76d4defbe7
27 changed files with 305 additions and 384 deletions
+6
View File
@@ -0,0 +1,6 @@
-- https://wiki.hypr.land/Configuring/Autostart/
-- Shared defaults — do not edit. Add user-specific autostart in custom/autostart.lua.
hl.on("hyprland.start", function()
hl.exec_cmd("qs -c noctalia-shell")
end)
+2
View File
@@ -0,0 +1,2 @@
-- https://wiki.hypr.land/Configuring/Environment-variables/
-- Shared defaults — do not edit. Add user-specific env vars in custom/environments.lua.
+20
View File
@@ -0,0 +1,20 @@
-- https://wiki.hypr.land/Configuring/Variables/#input
-- Shared defaults — do not edit. Add user-specific input config in custom/inputs.lua.
hl.config({
input = {
kb_layout = "fr",
kb_variant = "",
kb_model = "",
kb_options = "",
kb_rules = "",
follow_mouse = 1,
sensitivity = 0,
touchpad = {
natural_scroll = false,
},
},
})
-- https://wiki.hypr.land/Configuring/Gestures
hl.gesture({ fingers = 3, direction = "horizontal", action = "workspace" })
+87
View File
@@ -0,0 +1,87 @@
-- https://wiki.hypr.land/Configuring/Binds/
-- Shared defaults — do not edit. Add user-specific keybindings in custom/keybinds.lua.
local mainMod = "SUPER"
local terminal = "kitty"
local fileMgr = "nautilus"
local ipc = "qs -c noctalia-shell ipc call"
hl.bind("CTRL + ALT + T", hl.dsp.exec_cmd(terminal))
hl.bind(mainMod .. " + SPACE", hl.dsp.exec_cmd(ipc .. " launcher toggle"))
hl.bind(mainMod .. " + C", hl.dsp.window.close())
hl.bind(mainMod .. " + M", hl.dsp.exit())
hl.bind(mainMod .. " + E", hl.dsp.exec_cmd(fileMgr))
hl.bind(mainMod .. " + V", hl.dsp.window.float({ action = "toggle" }))
hl.bind(mainMod .. " + F", hl.dsp.window.fullscreen({ state = "toggle" }))
hl.bind(mainMod .. " + P", hl.dsp.window.pseudo())
hl.bind(mainMod .. " + U", hl.dsp.layout("togglesplit"))
hl.bind(mainMod .. " + H", hl.dsp.layout("swapsplit"))
-- Focus: arrow keys + IJKL
for _, m in ipairs({
{ "left", "l" }, { "right", "r" }, { "up", "u" }, { "down", "d" },
{ "J", "l" }, { "L", "r" }, { "I", "u" }, { "K", "d" },
}) do
hl.bind(mainMod .. " + " .. m[1], hl.dsp.focus({ direction = m[2] }))
end
-- Workspaces 1..10: digit + AZERTY keysym, plus SHIFT to move active window
local azerty = {
"ampersand", "eacute", "quotedbl", "apostrophe", "parenleft",
"minus", "egrave", "underscore", "ccedilla", "agrave",
}
for i = 1, 10 do
local digit = (i == 10) and "0" or tostring(i)
hl.bind(mainMod .. " + " .. digit, hl.dsp.focus({ workspace = i }))
hl.bind(mainMod .. " + " .. azerty[i], hl.dsp.focus({ workspace = i }))
hl.bind(mainMod .. " + SHIFT + " .. azerty[i], hl.dsp.window.move({ workspace = i }))
end
-- Special workspace (scratchpad)
hl.bind(mainMod .. " + S", hl.dsp.workspace.toggle_special("magic"))
hl.bind(mainMod .. " + SHIFT + S", hl.dsp.window.move({ workspace = "special:magic" }))
-- Mouse scroll between workspaces
hl.bind(mainMod .. " + mouse_down", hl.dsp.focus({ workspace = "e+1" }))
hl.bind(mainMod .. " + mouse_up", hl.dsp.focus({ workspace = "e-1" }))
-- Mouse drag / resize
hl.bind(mainMod .. " + mouse:272", hl.dsp.window.drag(), { mouse = true })
hl.bind(mainMod .. " + mouse:273", hl.dsp.window.resize(), { mouse = true })
-- Volume / brightness: locked + repeating
for _, b in ipairs({
{ "XF86AudioRaiseVolume", "wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+" },
{ "XF86AudioLowerVolume", "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" },
{ "XF86AudioMute", "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" },
{ "XF86AudioMicMute", "wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle" },
{ "XF86MonBrightnessUp", "brightnessctl -e4 -n2 set 5%+" },
{ "XF86MonBrightnessDown", "brightnessctl -e4 -n2 set 5%-" },
}) do
hl.bind(b[1], hl.dsp.exec_cmd(b[2]), { locked = true, repeating = true })
end
-- Media player: locked only
for _, b in ipairs({
{ "XF86AudioNext", "playerctl next" },
{ "XF86AudioPause", "playerctl play-pause" },
{ "XF86AudioPlay", "playerctl play-pause" },
{ "XF86AudioPrev", "playerctl previous" },
}) do
hl.bind(b[1], hl.dsp.exec_cmd(b[2]), { locked = true })
end
hl.bind("XF86Calculator", hl.dsp.exec_cmd("gnome-calculator"))
-- Noctalia IPC
hl.bind(mainMod .. " + T", hl.dsp.exec_cmd(ipc .. " darkMode toggle"))
hl.bind(mainMod .. " + SHIFT + L", hl.dsp.exec_cmd(ipc .. " lockScreen lock"))
hl.bind("Print", hl.dsp.exec_cmd(ipc .. " plugin:screenshot takeScreenshot region"), { locked = true })
hl.bind("CTRL + Print", hl.dsp.exec_cmd(ipc .. " plugin:screenshot takeScreenshot screen"), { locked = true })
-- Lid switch
hl.bind(
"switch:Lid Switch",
hl.dsp.exec_cmd(os.getenv("HOME") .. "/.config/hypr/scripts/lidClosed.sh"),
{ locked = true }
)
+65
View File
@@ -0,0 +1,65 @@
-- https://wiki.hypr.land/Configuring/Variables/
-- Shared defaults — do not edit. No custom/look-and-feel.lua override exists; add one if needed.
hl.config({
general = {
gaps_in = 5,
gaps_out = 10,
border_size = 2,
resize_on_border = false,
allow_tearing = false,
layout = "dwindle",
},
decoration = {
rounding = 12,
active_opacity = 1.0,
inactive_opacity = 1.0,
shadow = {
enabled = true,
range = 30,
render_power = 5,
offset = "0 5",
color = "rgba(00000070)",
},
blur = {
enabled = false,
size = 3,
passes = 1,
vibrancy = 0.1696,
},
},
animations = {
enabled = true,
},
dwindle = {
preserve_split = true,
},
master = {
new_status = "master",
mfact = 0.5,
},
misc = {
disable_splash_rendering = true,
force_default_wallpaper = 0,
disable_hyprland_logo = true,
},
xwayland = {
force_zero_scaling = true,
},
})
-- Animations: each animation is its own hl.animation() call.
-- See https://wiki.hypr.land/Configuring/Animations/
hl.animation({ leaf = "windowsIn", enabled = true, speed = 3, bezier = "default" })
hl.animation({ leaf = "windowsOut", enabled = true, speed = 3, bezier = "default" })
hl.animation({ leaf = "border", enabled = true, speed = 3, bezier = "default" })
hl.animation({ leaf = "borderangle", enabled = true, speed = 3, bezier = "default" })
hl.animation({ leaf = "fade", enabled = true, speed = 3, bezier = "default" })
hl.animation({ leaf = "workspaces", enabled = true, speed = 5, bezier = "default" })
hl.animation({ leaf = "windowsMove", enabled = true, speed = 4, bezier = "default" })
+4
View File
@@ -0,0 +1,4 @@
-- https://wiki.hypr.land/Configuring/Monitors/
-- Shared defaults — do not edit. Add user-specific monitor config in custom/monitors.lua.
hl.monitor({ output = "", mode = "preferred", position = "auto", scale = "auto" })
+9
View File
@@ -0,0 +1,9 @@
-- https://wiki.hypr.land/Configuring/Permissions/
-- Shared defaults — do not edit. No custom/permissions.lua override exists; add one if needed.
-- Permission changes require a Hyprland restart, not a reload.
-- hl.config({ ecosystem = { enforce_permissions = 1 } })
-- hl.permission({ path = "/usr/(bin|local/bin)/grim", capability = "screencopy", action = "allow" })
-- hl.permission({ path = "/usr/(lib|libexec|lib64)/xdg-desktop-portal-hyprland", capability = "screencopy", action = "allow" })
-- hl.permission({ path = "/usr/(bin|local/bin)/hyprpm", capability = "plugin", action = "allow" })
+42
View File
@@ -0,0 +1,42 @@
-- https://wiki.hypr.land/Configuring/Window-Rules/
-- Shared defaults — do not edit. Add user-specific window rules in custom/windowrules.lua.
hl.window_rule({
name = "floating-window",
match = { class = "(Imprimer l'image|org.gnome.Calculator|org.gnome.Loupe)" },
float = true,
})
hl.window_rule({
name = "kitty-term",
match = { class = "kitty" },
size = "(monitor_w*0.50) (monitor_h*0.47)",
float = true,
center = true,
})
hl.window_rule({
name = "floating-messages",
match = { class = "(signal|org.telegram.desktop)" },
size = "(monitor_w*0.27) (monitor_h*0.7)",
move = "(monitor_w*0.70) (monitor_h*0.15)",
float = true,
pin = true,
})
hl.window_rule({
name = "filesystems",
match = { class = "DevTools|Tous les fichiers|org.gnome.Nautilus" },
float = true,
center = true,
size = "(monitor_w*0.48) (monitor_h*0.5)",
})
hl.window_rule({
name = "pip",
match = { class = "zen", title = "Picture-in-Picture" },
center = true,
size = "1280 720",
float = true,
pin = true,
})