From edaaa0b3c00322483e42d80a70b34b09527297d5 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 29 Jan 2025 19:30:39 +0100 Subject: ... --- accounts/gkleen@sif/niri/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'accounts') diff --git a/accounts/gkleen@sif/niri/default.nix b/accounts/gkleen@sif/niri/default.nix index ca2dfeff..7e187c84 100644 --- a/accounts/gkleen@sif/niri/default.nix +++ b/accounts/gkleen@sif/niri/default.nix @@ -28,7 +28,11 @@ let while IFS=$'\n' read -r window_json; do if [[ -n $(jq -c "$window_select" <<<"$window_json") ]]; then - niri msg action focus-window --id "$(jq -r '.id' <<<"$window_json")" + if jq -e '.is_focused' <<<"$window_json" >/dev/null; then + niri msg action focus-workspace-previous + else + niri msg action focus-window --id "$(jq -r '.id' <<<"$window_json")" + fi exit 0 fi done < <(niri msg -j windows | jq -c '.[]') -- cgit v1.2.3