From 37cf063eb188e984705c50f65c613774237cc17b Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Sun, 14 Jun 2026 07:25:42 +0200 Subject: [PATCH] feat(hypr): (almost) complete lua rewrite of configs --- config/hypr/hyprland/core/style.lua | 86 ++++++++++++++----- config/hypr/hyprland/execs.lua | 6 ++ config/hypr/hyprland/layout/init.lua | 1 + config/hypr/hyprland/windowrules/floating.lua | 54 +++++++++++- config/hypr/hyprland/windowrules/idle.lua | 20 +++++ config/hypr/hyprland/windowrules/layer.lua | 1 - config/hypr/hyprland/windowrules/main.lua | 3 - .../hypr/hyprland/windowrules/positioning.lua | 0 config/hypr/hyprland/windowrules/tags.lua | 38 ++++++++ .../hypr/hyprland/windowrules/workspaces.lua | 30 ++++++- config/hypr/hyprland/workspacerules/main.lua | 20 +++++ 11 files changed, 229 insertions(+), 30 deletions(-) delete mode 100644 config/hypr/hyprland/windowrules/layer.lua delete mode 100644 config/hypr/hyprland/windowrules/main.lua delete mode 100644 config/hypr/hyprland/windowrules/positioning.lua create mode 100644 config/hypr/hyprland/workspacerules/main.lua diff --git a/config/hypr/hyprland/core/style.lua b/config/hypr/hyprland/core/style.lua index 85fe37f..1e312b5 100644 --- a/config/hypr/hyprland/core/style.lua +++ b/config/hypr/hyprland/core/style.lua @@ -1,26 +1,70 @@ hl.config({ - decoration = { - inactive_opacity = 1, - rounding = 10, + decoration = { + inactive_opacity = 1, + rounding = 10, - shadow = { - enabled = true, - range = 4, - }, + shadow = { + enabled = true, + range = 4, + }, - blur = { - enabled = true, - xray = true, - new_optimizations = true, - size = 1, - passes = 2, - }, + blur = { + enabled = true, + xray = true, + new_optimizations = true, + size = 1, + passes = 2, + }, - dim_inactive = true, - dim_strength = 0.1, - -- TODO: Consider adding glow? - }, - animations = { - enabled = true, - }, + dim_inactive = true, + dim_strength = 0.1, + -- TODO: Consider adding glow? + }, + animations = { + enabled = true, + }, +}) + +hl.curve("main-bezier", { + type = "bezier", + points = { { 0.05, 0.9 }, { 0.1, 1.05 } }, +}) + +hl.animation({ + leaf = "windowsIn", + enabled = true, + bezier = "main-bezier", + speed = 3, +}) + +hl.animation({ + leaf = "windowsOut", + enabled = true, + bezier = "main-bezier", + speed = 4, + style = "popin 80%" +}) + +hl.animation({ + leaf = "border", + enabled = true, + speed = 8, +}) + +hl.animation({ + leaf = "fade", + enabled = true, + speed = 3, +}) + +hl.animation({ + leaf = "workspace", + enabled = true, + speed = 1, +}) + +hl.animation({ + leaf = "specialWorkspace", + enabled = true, + speed = 1, }) diff --git a/config/hypr/hyprland/execs.lua b/config/hypr/hyprland/execs.lua index 279dccb..7941a23 100644 --- a/config/hypr/hyprland/execs.lua +++ b/config/hypr/hyprland/execs.lua @@ -3,4 +3,10 @@ hl.on("hyprland.start", function() -- hl.exec_cmd("dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XAUTHORITY DISPLAY") -- hl.exec_cmd("systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP") hl.exec_cmd("systemctl --user start hyprpolkitagent") + hl.exec_cmd("hypridle") + hl.exec_cmd("nm-applet") + hl.exec_cmd("nextcloud --background") + hl.exec_cmd("quickshell") + hl.exec_cmd("matugen") + hl.exec_cmd("wl-paste --type text --watch cliphist store") end) diff --git a/config/hypr/hyprland/layout/init.lua b/config/hypr/hyprland/layout/init.lua index e69de29..e2a5e74 100644 --- a/config/hypr/hyprland/layout/init.lua +++ b/config/hypr/hyprland/layout/init.lua @@ -0,0 +1 @@ +-- for the new layout https://wiki.hypr.land/Configuring/Advanced-and-Cool/Uncommon-tips-and-tricks/#per-layout-bindings diff --git a/config/hypr/hyprland/windowrules/floating.lua b/config/hypr/hyprland/windowrules/floating.lua index f264b94..6f0030e 100644 --- a/config/hypr/hyprland/windowrules/floating.lua +++ b/config/hypr/hyprland/windowrules/floating.lua @@ -1 +1,53 @@ --- Floating windows & their positioning +-- Floating windows +-- Float +hl.window_rule({ + match = { + tag = "dialog", + }, + float = true, + center = true, +}) + +-- No float +hl.window_rule({ + match = { + title = "launchers", + }, + float = false, +}) + +-- fullscreen +hl.window_rule({ + match = { + tag = "game", + }, + fullscreen = true, +}) +hl.window_rule({ + match = { + class = "wlogout", + }, + fullscreen = true, +}) + +-- Termfilechooser +hl.window_rule({ + match = { + title = "termfilechooser", + }, + float = true, + center = true, + dim_around = true, + size = { 1400, 800 }, +}) + +-- hidden terminator +hl.window_rule({ + match = { + title = "^hidden-terminator$", + }, + float = true, + center = true, + size = { 0, 0 }, + move = { 0, 0 } +}) diff --git a/config/hypr/hyprland/windowrules/idle.lua b/config/hypr/hyprland/windowrules/idle.lua index 2b36887..970d78d 100644 --- a/config/hypr/hyprland/windowrules/idle.lua +++ b/config/hypr/hyprland/windowrules/idle.lua @@ -1 +1,21 @@ -- Idleinhibits +hl.window_rule({ + match = { + tag = "game|launchers", + }, + idle_inhibit = "focus" +}) + +hl.window_rule({ + match = { + title = "Bitwarden|secret|[aA]uthentication" + }, + no_screen_share = true +}) + +hl.window_rule({ + match = { + class = "nm-connection-editor" + }, + no_screen_share = true +}) diff --git a/config/hypr/hyprland/windowrules/layer.lua b/config/hypr/hyprland/windowrules/layer.lua deleted file mode 100644 index 9eb7f60..0000000 --- a/config/hypr/hyprland/windowrules/layer.lua +++ /dev/null @@ -1 +0,0 @@ --- set the layer diff --git a/config/hypr/hyprland/windowrules/main.lua b/config/hypr/hyprland/windowrules/main.lua deleted file mode 100644 index 4a56018..0000000 --- a/config/hypr/hyprland/windowrules/main.lua +++ /dev/null @@ -1,3 +0,0 @@ -hl.window_rule({ - name = "" -}) diff --git a/config/hypr/hyprland/windowrules/positioning.lua b/config/hypr/hyprland/windowrules/positioning.lua deleted file mode 100644 index e69de29..0000000 diff --git a/config/hypr/hyprland/windowrules/tags.lua b/config/hypr/hyprland/windowrules/tags.lua index e69de29..2235509 100644 --- a/config/hypr/hyprland/windowrules/tags.lua +++ b/config/hypr/hyprland/windowrules/tags.lua @@ -0,0 +1,38 @@ +-- ┌ ┐ +-- │ Use tags to group windows into groups │ +-- └ ┘ +-- Games +hl.window_rule({ + match = { + class = "steam_app", + }, + tag = "+game", +}) +hl.window_rule({ + match = { + title = "Minecraft|Beat Saber", + }, + tag = "+game", +}) + +-- Launchers +hl.window_rule({ + match = { + class = "steam|minecraft-launcher|org\\.prismlauncher\\.PrismLauncher", + }, + tag = "+launchers", +}) + +-- Dialogs +hl.window_rule({ + match = { + class = "file_progress|confirm|dialog|download|notification|error|splash|confirmreset|lxappearance|pavucontrol|file-roller", + }, + tag = "+dialog", +}) +hl.window_rule({ + match = { + class = "SteamVR Status|Open File|Media viewer|Volume Control|Picture-in-Picture|File Operation Progress|Loading|AG Controller|AG Controller|Qalculate", + }, + tag = "+dialog", +}) diff --git a/config/hypr/hyprland/windowrules/workspaces.lua b/config/hypr/hyprland/windowrules/workspaces.lua index 1357955..79ce6a5 100644 --- a/config/hypr/hyprland/windowrules/workspaces.lua +++ b/config/hypr/hyprland/windowrules/workspaces.lua @@ -1,15 +1,37 @@ --- Set the workspace for certain apps +-- ┌ ┐ +-- │ Set the workspace for certain apps │ +-- └ ┘ +-- Workspace 1 hl.window_rule({ - match = { class = ".*steam_app.*", title = "ALVR.*|^hidden-terminator" }, + match = { tag = "game" }, + workspace = 1, +}) +hl.window_rule({ + match = { title = "ALVR|^hidden-terminator$" }, workspace = 1, }) +-- Workspace 2 hl.window_rule({ - match = { class = "evince|okular|org\\.pwmt\\.zathura|librewolf", title = "BSManager|Beat Saber.*" }, + match = { class = "evince|okular|org\\.pwmt\\.zathura|librewolf" }, + workspace = 2, +}) +hl.window_rule({ + match = { title = "BSManager" }, workspace = 2, }) +-- Workspace 3 hl.window_rule({ - match = { class = "minecraft-launcher", title = ".*Minecraft.*|.*[Ss]team.*" }, + match = { class = "minecraft-launcher" }, workspace = 3, }) +hl.window_rule({ + match = { title = "[Ss]team" }, + workspace = 3, +}) + +hl.window_rule({ + match = { title = "Qalculate|AG Controller" }, + workspace = "special", +}) diff --git a/config/hypr/hyprland/workspacerules/main.lua b/config/hypr/hyprland/workspacerules/main.lua new file mode 100644 index 0000000..f41324a --- /dev/null +++ b/config/hypr/hyprland/workspacerules/main.lua @@ -0,0 +1,20 @@ +hl.workspace_rule({ + workspace = "1", + monitor = "DP-1", + default = true, +}) +hl.workspace_rule({ + workspace = "2", + monitor = "DP-2", + default = true, +}) +hl.workspace_rule({ + workspace = "3", + monitor = "DP-1", + default = true, +}) +hl.workspace_rule({ + workspace = "4", + monitor = "DP-2", + default = true, +})