diff --git a/settings/hyprland.nix b/settings/hyprland.nix index b43f8b7..913a90d 100644 --- a/settings/hyprland.nix +++ b/settings/hyprland.nix @@ -490,6 +490,10 @@ in ''; nmcli = "${pkgs.networkmanager}/bin/nmcli"; powerprofilesctl = "${pkgs.power-profiles-daemon}/bin/powerprofilesctl"; + focusTrayWindow = pkgs.writeShellScript "focus-tray-window" '' + addr=$(hyprctl clients -j | ${pkgs.jq}/bin/jq -r '.[] | select(.class=="steam_app_0" and .title!="") | .address' | head -1) + [ -n "$addr" ] && hyprctl eval "hl.dispatch(hl.dsp.focus({window = \"address:$addr\"}))" + ''; in { "quickshell/qmldir" = { onChange = qsRestart; @@ -1151,6 +1155,11 @@ in color: Theme.base05 } + Process { + id: trayFocusProc + command: ["${focusTrayWindow}"] + } + MouseArea { anchors.fill: parent hoverEnabled: true @@ -1204,7 +1213,7 @@ in } else { modelData.activate(); if (!modelData.hasMenu) { - Hyprland.dispatch("focuswindow class:steam_app_0 title:Battle.net"); + trayFocusProc.running = true; } } }