From 8510ea5c4fbde744e9ca9502f98e86629a9ca3a4 Mon Sep 17 00:00:00 2001 From: rope Date: Thu, 4 Jun 2026 14:32:14 +0100 Subject: [PATCH] quickshell: fix tray click via hyprctl eval for Lua mode Use a shell script to find the window address and focus it via hl.dispatch(hl.dsp.focus()) since hyprctl dispatch syntax changed in Hyprland 0.55+ Lua mode. Co-Authored-By: Claude Opus 4.6 --- settings/hyprland.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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; } } }