fix(hypr): reliable gaming workspace focus across monitors
- 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 <noreply@anthropic.com>
This commit is contained in:
@@ -18,7 +18,8 @@
|
|||||||
# Close special workspace on gaming monitor if open
|
# 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')
|
special=$(${pkgs.hyprland}/bin/hyprctl monitors -j | ${pkgs.jq}/bin/jq -r '.[] | select(.name == "${gamingMonitor}") | .specialWorkspace.name')
|
||||||
if [[ -n "$special" ]]; then
|
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
|
else
|
||||||
${pkgs.hyprland}/bin/hyprctl --batch "dispatch focusmonitor ${gamingMonitor};dispatch workspace name:gaming"
|
${pkgs.hyprland}/bin/hyprctl --batch "dispatch focusmonitor ${gamingMonitor};dispatch workspace name:gaming"
|
||||||
fi
|
fi
|
||||||
@@ -37,7 +38,8 @@
|
|||||||
[[ "$class" == "heroic" ]]; then
|
[[ "$class" == "heroic" ]]; then
|
||||||
special=$(${pkgs.hyprland}/bin/hyprctl monitors -j | ${pkgs.jq}/bin/jq -r '.[] | select(.name == "${gamingMonitor}") | .specialWorkspace.name')
|
special=$(${pkgs.hyprland}/bin/hyprctl monitors -j | ${pkgs.jq}/bin/jq -r '.[] | select(.name == "${gamingMonitor}") | .specialWorkspace.name')
|
||||||
if [[ -n "$special" ]]; then
|
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
|
else
|
||||||
${pkgs.hyprland}/bin/hyprctl --batch "dispatch focusmonitor ${gamingMonitor};dispatch workspace name:gaming"
|
${pkgs.hyprland}/bin/hyprctl --batch "dispatch focusmonitor ${gamingMonitor};dispatch workspace name:gaming"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user