From: Andre Ramnitz Date: Thu, 17 Sep 2026 17:59:23 +0000 (+0200) Subject: hypr: refactor windowrules X-Git-Url: https://git.ramnitz.eu/?a=commitdiff_plain;h=1aca7046bd1654f25ce91cd4436fdab0d3571f44;p=dotfiles.git hypr: refactor windowrules --- diff --git a/dot-config/hypr/fragments/env.lua b/dot-config/hypr/fragments/env.lua index abfd7d5..ec56f13 100644 --- a/dot-config/hypr/fragments/env.lua +++ b/dot-config/hypr/fragments/env.lua @@ -9,7 +9,7 @@ hl.env("XDG_CURRENT_DESKTOP", "Hyprland") hl.env("XDG_SESSION_DESKTOP", "Hyprland") -- amd stuff -hl.env("AMD_VULKAN_ICD", "RADV") +-- hl.env("AMD_VULKAN_ICD=, "RADV") -- prefer wayland hl.env("QT_QPA_PLATFORM", "wayland;xcb") diff --git a/dot-config/hypr/fragments/windowrules.lua b/dot-config/hypr/fragments/windowrules.lua index c36d7be..87ea500 100644 --- a/dot-config/hypr/fragments/windowrules.lua +++ b/dot-config/hypr/fragments/windowrules.lua @@ -27,19 +27,19 @@ hl.window_rule({ hl.window_rule({ name = "floating_enable", - float = true, match = { class = "^((VirtualBox|qtpass|org.ijhack.qtpass|org.kde|smplayer|mpv|ark|lxqt|vlc|pcmanfm|kdesystemsettings|gimp|openrgb|nwg-look|alsa-scarlett-gui|lstopo|org.corectrl.CoreCtrl|LACT|lutris|blueman-manager|org.freedesktop.impl.portal|be.alexandervanhee.gradia|io.missioncenter.MissionCenter|io.github.ilya_zlobintsev.LACT|ncmpcpp).*)$", }, + float = true, }) hl.window_rule({ name = "floating_enable_size_1200", - float = true, - size = "1200 1200", match = { class = "^((com.system76.CosmicMonitor|qalculate|clipse).*)$", }, + float = true, + size = "1200 1200", }) hl.window_rule({ @@ -64,53 +64,36 @@ hl.window_rule({ hl.window_rule({ name = "dialogs_floating_bytitle", - float = true, match = { title = "^((Über|About|Öffnen|org.freedesktop.impl.portal.desktop.kde).*)$", }, + float = true, }) hl.window_rule({ name = "dialogs_focused_bytitle", - stay_focused = true, match = { title = "^((Über|About|Öffnen|Neuen Ordner erstellen|Datei überschreiben|Create New Folder|org.freedesktop.impl.portal).*)$", }, + stay_focused = true, }) hl.window_rule({ name = "dialogs_focused_byclass", - float = true, - stay_focused = true, match = { class = "^((org.gnupg.pinentry-qt|org.kde.kwalletd6|org.kde.ksecretd|org.kde.polkit-kde-authentication-agent-1).*)$", }, -}) - -hl.window_rule({ - name = "game_launchers", float = true, - match = { - title = "^(.*)auncher$", - }, -}) - -hl.window_rule({ - name = "heroic", stay_focused = true, - match = { - class = "negative:heroic", - title = "^(.*)Launcher$", - }, }) -- indicate windows with special attention hl.window_rule({ name = "upgrayyedd", - border_color = surface, match = { - initial_title = "^(upgrayyedd)$", + title = "^(upgrayyedd)$", }, + border_color = tertiary, }) -- handle windows tray items (xembedsniproxy) @@ -121,75 +104,81 @@ hl.window_rule({ -- windowrule = noblur, title:^()$, class:^()$ hl.window_rule({ - name = "browsers", - tag = "+neverdim", - workspace = 1, - group = "deny", + name = "add_browsers_to_neverdim", match = { class = "^(firefox|firefox-bin|org.qutebrowser.qutebrowser|Microsoft-edge.*|qutebrowser)$", }, + tag = "+neverdim", + workspace = 1, + group = "deny", }) hl.window_rule({ name = "workspace2", - workspace = 2, match = { class = "^(pm|tm|pr|thunderbird|thunderbird-bin)$", }, + workspace = 2, }) hl.window_rule({ name = "workspace3", - pseudo = true, - no_initial_focus = true, - workspace = 3, match = { class = "^(Threema.*|discord.*)$", }, + pseudo = true, + no_initial_focus = true, + workspace = 3, }) hl.window_rule({ name = "workspace4", - workspace = 4, match = { class = "^((deezer|ncmpcpp|spotify).*)$", }, + workspace = 4, }) hl.window_rule({ - name = "workspace5", - workspace = 5, + name = "workspace5.1", match = { + initial_class = "^(steam|heroic).*$", }, + workspace = 5, }) hl.window_rule({ - name = "workspace5", - workspace = 5, + name = "workspace5.2", match = { - initial_class = "^(steam|heroic).*$", + initial_class = "steam_app_default", + initial_title = "Battle.net(.*)", + workspace = 5, }, }) hl.window_rule({ name = "workspace6", - workspace = 6, match = { - initial_class = "^(steam_app).*$", + content = "game", }, + workspace = 6, }) hl.window_rule({ name = "workspace7", - workspace = 7, match = { class = "^(gimp|krita|ardour).*$", }, + workspace = 7, }) -- handle video PiPs hl.window_rule({ name = "windowrule-26", + match = { + class = "^(firefox.*)$", + initial_title = "^(Bild-im-Bild|Picture-in-Picture)$", + }, float = true, move = "((monitor_w)-813) (55)", size = "800 450", @@ -199,11 +188,7 @@ hl.window_rule({ border_size = 0, content = "video", tag = "+neverdim", - -- hyprbars:no_bar = true, - match = { - class = "^(firefox.*)$", - initial_title = "^(Bild-im-Bild|Picture-in-Picture)$", - }, + ["hyprbars:no_bar"] = true }) -- handle terminal(s/-apps) @@ -214,38 +199,46 @@ hl.window_rule({ hl.window_rule({ name = "popup_class", - float = true, - group = "deny", - size = "1280 800", match = { class = "^(popup)$", }, + float = true, + group = "deny", + size = "1280 800", }) hl.window_rule({ name = "kakpopupmove", + match = { + class = "^(kakpopup)$", + }, float = true, stay_focused = true, group = "deny", opacity = "1.0 override", size = "1200 600", move = "((monitor_w-1.7*window_w)-20) ((monitor_h-1.2*window_h)-10)", - match = { - class = "^(kakpopup)$", - }, }) -- handle ueberzugpp hl.window_rule({ name = "windowrule-49", + match = { + class = "^(ueberzugpp.*)$", + }, no_anim = true, no_initial_focus = true, decorate = false, no_shadow = true, group = "deny", +}) + +hl.window_rule({ + name = "vkcube", match = { - class = "^(ueberzugpp.*)$", + initial_title = "^(vkcube)$", }, + fullscreen = true, }) hl.window_rule({ @@ -278,57 +271,72 @@ hl.window_rule({ move = "((monitor_w*1)-window_w-10) ((monitor_h*0.25))", }) --- handle wine/proton games -local GAMES = "^(steam_app_.*|steam_proton|streaming_client|gamescope)$" +hl.window_rule({ + name = "battle.net", + match = { + initial_class = "^steam_app_default$", + title = "(^Battle.net(.*)|)$", + }, + float = true, + no_shadow = true, + rounding = 3, + ["hyprbars:no_bar"] = true +}) hl.window_rule({ - name = "windowrule-56", - tag = "+game", + name = "heroic", match = { - initial_class = GAMES, + initial_class = "heroic", + title = "^(.*)Launcher$", }, + float = true, + no_shadow = true, + rounding = 3, + ["hyprbars:no_bar"] = true }) hl.window_rule({ - name = "windowrule-57", + name = "tag_all_games", + match = { + class = "^(steam_app_%d(.*)|steam_proton|streaming_client|gamescope)$", + }, + tag = "+game", +}) + +hl.window_rule({ + name = "disable_eyecandy_fortag", + match = { + tag = "game", + }, content = "game", float = true, no_dim = true, no_blur = true, - rounding = 0, + rounding = false, no_shadow = true, no_anim = true, opaque = true, - min_size = "1280 800", + -- min_size = "1280 800", move = "((monitor_w*0.5)) ((monitor_h*0.5))", idle_inhibit = "always", fullscreen = true, - match = { - tag = "game", - }, }) -- handle TAGS (always handle tags last) hl.window_rule({ name = "neverdim", - no_dim = true, match = { tag = "neverdim", }, + no_dim = true, }) -hl.window_rule({ - name = "windowrule-60", - fullscreen = true, - match = { - initial_title = "^(vkcube)$", - }, - -- hl.window_rule({ -- name = "immediate_exp", --- immediate = true, -- match = { --- initial_title = "tag:game", +-- tag = "game", -- }, -}) +-- immediate = true, +--}) + diff --git a/dot-config/hypr/hyprland.lua b/dot-config/hypr/hyprland.lua index c84f284..30c82cd 100644 --- a/dot-config/hypr/hyprland.lua +++ b/dot-config/hypr/hyprland.lua @@ -104,8 +104,10 @@ hl.config({ border_size = 2, col = { - active_border = { colors = {"rgba(33ccffee)", "rgba(00ff99ee)"}, angle = 45 }, - inactive_border = "rgba(595959aa)", + -- active_border = { colors = {"rgba(33ccffee)", "rgba(00ff99ee)"}, angle = 45 }, + -- inactive_border = "rgba(595959aa)", + nogroup_border_active = "rgb(bb8888)", + nogroup_border = "rgb(bb8888)", }, -- Set to true to enable resizing windows by clicking and dragging on borders and gaps @@ -306,7 +308,7 @@ hl.config({ bar_text_font = "ZedMono NFP", bar_text_size = 16, bar_height = 24, - bar_color = "rgb(101010)", + bar_color = surface, -- title_color = "rgb(efefef)", bar_part_of_window = 1, bar_precedence_over_border = 1, @@ -403,8 +405,7 @@ require("fragments.workspacerules") require("fragments.layerrules") require("fragments.animations") require("fragments.windowrules") -require("noctalia.noctalia-colors") - -- For Noctalia Color templates require("noctalia").apply_theme() + diff --git a/dot-config/hypr/noctalia.lua b/dot-config/hypr/noctalia.lua index 8e0395f..c672901 100644 --- a/dot-config/hypr/noctalia.lua +++ b/dot-config/hypr/noctalia.lua @@ -1,12 +1,12 @@ -- Generated by Noctalia -local primary = "rgb(ffc799)" -local surface = "rgb(0c0c0c)" -local on_surface = "rgb(ffffff)" -local secondary = "rgb(99ffe4)" -local on_secondary = "rgb(000000)" -local error = "rgb(ff8080)" -local on_error = "rgb(000000)" +local primary = "rgb(b48ead)" +local surface = "rgb(2e3440)" +local on_surface = "rgb(eceff4)" +local secondary = "rgb(a3be8c)" +local on_secondary = "rgb(2e3440)" +local error = "rgb(bf616a)" +local on_error = "rgb(2e3440)" local function apply_theme() hl.config({ @@ -14,6 +14,8 @@ local function apply_theme() col = { active_border = primary, inactive_border = surface, + nogroup_border_active = primary, + nogroup_border = surface, }, }, group = { diff --git a/dot-config/hypr/scripts/gamemode.sh b/dot-config/hypr/scripts/gamemode.sh index 5f16c8d..ea10625 100755 --- a/dot-config/hypr/scripts/gamemode.sh +++ b/dot-config/hypr/scripts/gamemode.sh @@ -36,7 +36,7 @@ if [ "$COMFY" = true ] ; then float_switch_override_focus = 0, }, })' - noctalia msg power-set Performance + noctalia msg power-set performance noctalia msg wallpaper-set color:\#333333 noctalia msg nightlight-disable noctalia msg osd-disable