diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2025-05-17 13:16:11 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2025-05-17 13:16:11 +0200 |
commit | b8dc38b25ae240edb9b0ea5d4dde77d069a8ec6e (patch) | |
tree | 163c43f35735de8aa832b6ed2788f20e247ed2d0 /accounts/gkleen@sif/niri/default.nix | |
parent | 0f7466b548bbdf98298ec11c232674c6853a7e6a (diff) | |
download | nixos-b8dc38b25ae240edb9b0ea5d4dde77d069a8ec6e.tar nixos-b8dc38b25ae240edb9b0ea5d4dde77d069a8ec6e.tar.gz nixos-b8dc38b25ae240edb9b0ea5d4dde77d069a8ec6e.tar.bz2 nixos-b8dc38b25ae240edb9b0ea5d4dde77d069a8ec6e.tar.xz nixos-b8dc38b25ae240edb9b0ea5d4dde77d069a8ec6e.zip |
...
Diffstat (limited to 'accounts/gkleen@sif/niri/default.nix')
-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 31ac94d5..80f63e65 100644 --- a/accounts/gkleen@sif/niri/default.nix +++ b/accounts/gkleen@sif/niri/default.nix | |||
@@ -35,7 +35,11 @@ let | |||
35 | if jq -e '.is_focused' <<<"$window_json" >/dev/null; then | 35 | if jq -e '.is_focused' <<<"$window_json" >/dev/null; then |
36 | niri msg action focus-workspace-previous | 36 | niri msg action focus-workspace-previous |
37 | else | 37 | else |
38 | niri msg action focus-window --id "$(jq -r '.id' <<<"$window_json")" | 38 | if [[ $(jq -r --arg workspace_name "$workspace_name" 'map(select(.name == $workspace_name)) | .[0].is_focused' <<<"$workspaces_json") != "true" ]] && [[ $(jq -r --arg workspace_name "$workspace_name" 'map(select(.name == $workspace_name)) | .[0].id' <<<"$workspaces_json") = $(jq -r '.workspace_id' <<<"$window_json") ]]; then |
39 | niri msg action focus-workspace "$workspace_name" | ||
40 | else | ||
41 | niri msg action focus-window --id "$(jq -r '.id' <<<"$window_json")" | ||
42 | fi | ||
39 | fi | 43 | fi |
40 | exit 0 | 44 | exit 0 |
41 | fi | 45 | fi |