diff options
-rw-r--r-- | accounts/gkleen@sif/niri/default.nix | 6 |
1 files changed, 5 insertions, 1 deletions
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 | |||
28 | 28 | ||
29 | while IFS=$'\n' read -r window_json; do | 29 | while IFS=$'\n' read -r window_json; do |
30 | if [[ -n $(jq -c "$window_select" <<<"$window_json") ]]; then | 30 | if [[ -n $(jq -c "$window_select" <<<"$window_json") ]]; then |
31 | niri msg action focus-window --id "$(jq -r '.id' <<<"$window_json")" | 31 | if jq -e '.is_focused' <<<"$window_json" >/dev/null; then |
32 | niri msg action focus-workspace-previous | ||
33 | else | ||
34 | niri msg action focus-window --id "$(jq -r '.id' <<<"$window_json")" | ||
35 | fi | ||
32 | exit 0 | 36 | exit 0 |
33 | fi | 37 | fi |
34 | done < <(niri msg -j windows | jq -c '.[]') | 38 | done < <(niri msg -j windows | jq -c '.[]') |