From 428488f11ddc6ebd91fc2c36f5ea5131f6338d53 Mon Sep 17 00:00:00 2001 From: kenji Date: Fri, 16 Jan 2026 19:36:10 -0600 Subject: [PATCH] feat(hyprland): improve gaming experience and workspace navigation - Implemented a modular gaming configuration with a local games list. - Added dynamic window rules for games: monitor 0, dedicated 'gaming' workspace, fullscreen, immediate mode, and stayfocused. - Enabled 'allow_tearing' to support immediate mode for reduced latency. - Created a dedicated 'name:gaming' workspace bound to monitor 0 with a 'SUPER+G' shortcut. - Enabled 'workspace_back_and_forth' for intuitive workspace toggling. --- apps/hyprland/hypr/binds.nix | 3 ++ apps/hyprland/hypr/general.nix | 1 + modules/home/gaming.nix | 67 ++++++++++++++++++++++++++-------- 3 files changed, 55 insertions(+), 16 deletions(-) diff --git a/apps/hyprland/hypr/binds.nix b/apps/hyprland/hypr/binds.nix index 964492e..026e4f2 100644 --- a/apps/hyprland/hypr/binds.nix +++ b/apps/hyprland/hypr/binds.nix @@ -1,6 +1,9 @@ {pkgs, ...}: { # TODO: implement a way to show binds, preferably use vicinae. wayland.windowManager.hyprland.settings = { + binds = { + workspace_back_and_forth = true; + }; bindel = [ ", XF86MonBrightnessUp, exec, ddcutil setvcp 10 + 10" ", XF86MonBrightnessDown, exec, ddcutil setvcp 10 - 10" diff --git a/apps/hyprland/hypr/general.nix b/apps/hyprland/hypr/general.nix index df01278..0e8621e 100644 --- a/apps/hyprland/hypr/general.nix +++ b/apps/hyprland/hypr/general.nix @@ -4,6 +4,7 @@ gaps_in = 5; gaps_out = 15; layout = "dwindle"; + allow_tearing = true; }; decoration = { rounding = 0; diff --git a/modules/home/gaming.nix b/modules/home/gaming.nix index 2699c00..bbf2e8e 100644 --- a/modules/home/gaming.nix +++ b/modules/home/gaming.nix @@ -1,4 +1,30 @@ -{pkgs, ...}: { +{ + 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 @@ -19,6 +45,10 @@ }; wayland.windowManager.hyprland.settings = { + workspace = [ + "name:gaming, monitor:0, default:true" + ]; + exec-once = [ "[workspace special:steam silent] uwsm app -- steam" ]; @@ -26,24 +56,29 @@ 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)$" + 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 1, class:^steam_app_\d+$" + # --- 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 .*$" - ]; + "fullscreen, class:^(gamescope)$" + "fullscreen, class:^(lutris)$" + "fullscreen, class:^(heroic)$" + "fullscreen, class:^wine-.*$" + "fullscreen, title:^Wine .*$" + ] + ++ gameRules; }; }