diff options
Diffstat (limited to 'accounts/gkleen@sif/niri/default.nix')
-rw-r--r-- | accounts/gkleen@sif/niri/default.nix | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/accounts/gkleen@sif/niri/default.nix b/accounts/gkleen@sif/niri/default.nix index 628a8161..2e9b6909 100644 --- a/accounts/gkleen@sif/niri/default.nix +++ b/accounts/gkleen@sif/niri/default.nix | |||
@@ -98,7 +98,7 @@ let | |||
98 | with-unnamed-workspace-action = config.lib.niri.actions.spawn (lib.getExe with_unnamed_workspace); | 98 | with-unnamed-workspace-action = config.lib.niri.actions.spawn (lib.getExe with_unnamed_workspace); |
99 | 99 | ||
100 | with_select_window = pkgs.writeShellApplication { | 100 | with_select_window = pkgs.writeShellApplication { |
101 | name = "with-unnamed-workspace"; | 101 | name = "with-select-window"; |
102 | runtimeInputs = [ niri pkgs.gojq pkgs.socat config.programs.fuzzel.package pkgs.gawk ]; | 102 | runtimeInputs = [ niri pkgs.gojq pkgs.socat config.programs.fuzzel.package pkgs.gawk ]; |
103 | text = '' | 103 | text = '' |
104 | window_select="$1" | 104 | window_select="$1" |
@@ -108,9 +108,9 @@ let | |||
108 | 108 | ||
109 | windows_json="$(niri msg -j windows)" | 109 | windows_json="$(niri msg -j windows)" |
110 | active_workspace="$(jq -r '.[] | select(.is_focused) | .workspace_id' <<<"$windows_json")" | 110 | active_workspace="$(jq -r '.[] | select(.is_focused) | .workspace_id' <<<"$windows_json")" |
111 | window="$(gojq -r --arg active_workspace "$active_workspace" '.[] | select('"$window_select"') | "\(.title)\t\(.id)"' <<<"$windows_json" | fuzzel --log-level=warning --dmenu)" | 111 | window_ix="$(gojq -r --arg active_workspace "$active_workspace" '.[] | select('"$window_select"') | "\(.title)\u0000icon\u001f\(.app_id)"' <<<"$windows_json" | fuzzel --log-level=warning --dmenu --index)" |
112 | window_id="$(awk -F $'\t' '{print $2}' <<<"$window")" | 112 | # shellcheck disable=SC2016 |
113 | window_json="$(jq -r --arg window_id "$window_id" '.[] | select(.id == ($window_id | tonumber))' <<<"$windows_json")" | 113 | window_json="$(gojq -rc --arg active_workspace "$active_workspace" --arg window_ix "$window_ix" 'map(select('"$window_select"')) | .[($window_ix | tonumber)]' <<<"$windows_json")" |
114 | 114 | ||
115 | [[ -z "$window_json" ]] && exit 1 | 115 | [[ -z "$window_json" ]] && exit 1 |
116 | 116 | ||