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 <noreply@anthropic.com>
This commit is contained in:
parent
166280fa33
commit
8510ea5c4f
1 changed files with 10 additions and 1 deletions
|
|
@ -490,6 +490,10 @@ in
|
||||||
'';
|
'';
|
||||||
nmcli = "${pkgs.networkmanager}/bin/nmcli";
|
nmcli = "${pkgs.networkmanager}/bin/nmcli";
|
||||||
powerprofilesctl = "${pkgs.power-profiles-daemon}/bin/powerprofilesctl";
|
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 {
|
in {
|
||||||
"quickshell/qmldir" = {
|
"quickshell/qmldir" = {
|
||||||
onChange = qsRestart;
|
onChange = qsRestart;
|
||||||
|
|
@ -1151,6 +1155,11 @@ in
|
||||||
color: Theme.base05
|
color: Theme.base05
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Process {
|
||||||
|
id: trayFocusProc
|
||||||
|
command: ["${focusTrayWindow}"]
|
||||||
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
|
|
@ -1204,7 +1213,7 @@ in
|
||||||
} else {
|
} else {
|
||||||
modelData.activate();
|
modelData.activate();
|
||||||
if (!modelData.hasMenu) {
|
if (!modelData.hasMenu) {
|
||||||
Hyprland.dispatch("focuswindow class:steam_app_0 title:Battle.net");
|
trayFocusProc.running = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue