{ pkgs, lib, myConfig, ... }: let games = [ "Deadlock" ]; # Generate monitor rules for each game in the config gameRules = lib.flatten (map (game: [ "monitor 0, title:^(${game})$" "workspace name:gaming, title:^(${game})$" "fullscreen, title:^(${game})$" "immediate, title:^(${game})$" "stayfocused, title:^(${game})$" "monitor 0, class:^(${game})$" "workspace name:gaming, class:^(${game})$" "fullscreen, class:^(${game})$" "immediate, class:^(${game})$" "stayfocused, class:^(${game})$" ]) games); in { home.packages = with pkgs; [ protonup-qt protontricks mangohud via ]; programs.mangohud = { enable = true; settings = { full = true; no_display = true; # Don't show by default (toggle with Shift+F12) cpu_temp = true; gpu_temp = true; ram = true; vram = true; }; }; wayland.windowManager.hyprland.settings = { workspace = [ "name:gaming, monitor:0, default:true" ]; exec-once = [ "[workspace special:steam silent] uwsm app -- steam" ]; bindd = [ "SUPER, T, Toggle Steam, togglespecialworkspace, steam" "SUPER SHIFT, T, Move to Steam Special Workspace, movetoworkspace, special:steam" "SUPER, G, Switch to Gaming Workspace, workspace, name:gaming" ]; windowrulev2 = [ # --- STEAM RULES --- "workspace special:steam silent, class:^(steam)$" "noinitialfocus, 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; }; }