From fe0d006f2e0822db7b780999c5d8e059cefdcb03 Mon Sep 17 00:00:00 2001 From: CLAUDE AI Date: Thu, 28 May 2026 08:13:47 -0500 Subject: [PATCH] fix(hypr): reliable gaming workspace focus across monitors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add gaming-focus script: closes special workspace on DP-1 via --batch dispatch (fixes async race), then focuses gaming workspace; replaces raw workspace binding for SUPER+G - Add game-focus-watcher: listens on Hyprland socket, auto-focuses gaming workspace when a game launches regardless of current monitor - Fix monitor 0 → DP-1 in mkGameRules and steam_app windowrules - Fix steam dialogs leaking to normal workspaces (broaden workspace rule from title:Steam to all class:steam) - Extract gamingMonitor variable as single source of truth - Drop redundant workspace dispatch after togglespecialworkspace to prevent game freeze on special→gaming transition Co-Authored-By: Claude Sonnet 4.6 --- modules/home/gaming.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/home/gaming.nix b/modules/home/gaming.nix index ecc78ee..9aeea37 100644 --- a/modules/home/gaming.nix +++ b/modules/home/gaming.nix @@ -18,7 +18,8 @@ # Close special workspace on gaming monitor if open special=$(${pkgs.hyprland}/bin/hyprctl monitors -j | ${pkgs.jq}/bin/jq -r '.[] | select(.name == "${gamingMonitor}") | .specialWorkspace.name') if [[ -n "$special" ]]; then - ${pkgs.hyprland}/bin/hyprctl --batch "dispatch focusmonitor ${gamingMonitor};dispatch togglespecialworkspace ''${special#special:};dispatch focusmonitor ${gamingMonitor};dispatch workspace name:gaming" + # Gaming workspace is already underneath — just close the special overlay + ${pkgs.hyprland}/bin/hyprctl --batch "dispatch focusmonitor ${gamingMonitor};dispatch togglespecialworkspace ''${special#special:}" else ${pkgs.hyprland}/bin/hyprctl --batch "dispatch focusmonitor ${gamingMonitor};dispatch workspace name:gaming" fi @@ -37,7 +38,8 @@ [[ "$class" == "heroic" ]]; then special=$(${pkgs.hyprland}/bin/hyprctl monitors -j | ${pkgs.jq}/bin/jq -r '.[] | select(.name == "${gamingMonitor}") | .specialWorkspace.name') if [[ -n "$special" ]]; then - ${pkgs.hyprland}/bin/hyprctl --batch "dispatch focusmonitor ${gamingMonitor};dispatch togglespecialworkspace ''${special#special:};dispatch focusmonitor ${gamingMonitor};dispatch workspace name:gaming" + # Gaming workspace is already underneath — just close the special overlay + ${pkgs.hyprland}/bin/hyprctl --batch "dispatch focusmonitor ${gamingMonitor};dispatch togglespecialworkspace ''${special#special:}" else ${pkgs.hyprland}/bin/hyprctl --batch "dispatch focusmonitor ${gamingMonitor};dispatch workspace name:gaming" fi