feat(gaming): unify and automate game window rules
Refactors 'modules/home/gaming.nix' to use a unified 'mkGameRules' function. Applies full gaming rules (monitor 0, workspace gaming, immediate, fullscreen) to: - Steam apps (class:^steam_app_\d+$) - Gamescope, Lutris, Heroic - Wine/Proton windows Preserves manual overrides in the 'games' list.
This commit is contained in:
+24
-30
@@ -8,22 +8,20 @@
|
|||||||
"Deadlock"
|
"Deadlock"
|
||||||
];
|
];
|
||||||
|
|
||||||
# Generate monitor rules for each game in the config
|
mkGameRules = selector: [
|
||||||
gameRules =
|
"monitor 0, ${selector}"
|
||||||
lib.flatten (map (game: [
|
"workspace name:gaming, ${selector}"
|
||||||
"monitor 0, title:^(${game})$"
|
"fullscreen, ${selector}"
|
||||||
"workspace name:gaming, title:^(${game})$"
|
"immediate, ${selector}"
|
||||||
"fullscreen, title:^(${game})$"
|
"stayfocused, ${selector}"
|
||||||
"immediate, title:^(${game})$"
|
];
|
||||||
"stayfocused, title:^(${game})$"
|
|
||||||
|
|
||||||
"monitor 0, class:^(${game})$"
|
manualGameRules = lib.flatten (map (
|
||||||
"workspace name:gaming, class:^(${game})$"
|
game:
|
||||||
"fullscreen, class:^(${game})$"
|
(mkGameRules "title:^(${game})$")
|
||||||
"immediate, class:^(${game})$"
|
++ (mkGameRules "class:^(${game})$")
|
||||||
"stayfocused, class:^(${game})$"
|
)
|
||||||
])
|
games);
|
||||||
games);
|
|
||||||
in {
|
in {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
protonup-qt
|
protonup-qt
|
||||||
@@ -61,24 +59,20 @@ in {
|
|||||||
|
|
||||||
windowrulev2 =
|
windowrulev2 =
|
||||||
[
|
[
|
||||||
# --- STEAM RULES ---
|
# --- STEAM LAUNCHER RULES ---
|
||||||
"workspace special:steam silent, class:^(steam)$"
|
"workspace special:steam silent, class:^(steam)$"
|
||||||
"noinitialfocus, class:^(steam)$"
|
"noinitialfocus, class:^(steam)$"
|
||||||
"suppressevent activate, class:^(steam)$"
|
"suppressevent activate, class:^(steam)$"
|
||||||
|
|
||||||
# --- GAMING RULES ---
|
|
||||||
"fullscreen, class:^steam_app_\d+$"
|
|
||||||
"monitor 0, class:^steam_app_\d+$"
|
|
||||||
"workspace name:gaming, class:^steam_app_\d+$"
|
|
||||||
"immediate, class:^steam_app_\d+$"
|
|
||||||
"stayfocused, class:^steam_app_\d+$"
|
|
||||||
|
|
||||||
"fullscreen, class:^(gamescope)$"
|
|
||||||
"fullscreen, class:^(lutris)$"
|
|
||||||
"fullscreen, class:^(heroic)$"
|
|
||||||
"fullscreen, class:^wine-.*$"
|
|
||||||
"fullscreen, title:^Wine .*$"
|
|
||||||
]
|
]
|
||||||
++ gameRules;
|
# --- AUTO-DETECTED GAMES ---
|
||||||
|
++ (mkGameRules "class:^steam_app_\\d+$")
|
||||||
|
++ (mkGameRules "class:^(gamescope)$")
|
||||||
|
++ (mkGameRules "class:^(lutris)$")
|
||||||
|
++ (mkGameRules "class:^(heroic)$")
|
||||||
|
++ (mkGameRules "class:^wine-.*$")
|
||||||
|
++ (mkGameRules "title:^Wine .*$")
|
||||||
|
# --- MANUAL GAMES ---
|
||||||
|
++ manualGameRules;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user