summaryrefslogtreecommitdiff
path: root/accounts/gkleen@sif/niri
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2025-01-23 15:36:31 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2025-01-23 15:36:31 +0100
commit08414045a56517d95e94f55c406ec8940336c6c7 (patch)
treec892416476e41a8df5a08b094db2eb992be8de78 /accounts/gkleen@sif/niri
parent6283e7caeb1cf4dc953671ec11956430cf6aa0c5 (diff)
downloadnixos-08414045a56517d95e94f55c406ec8940336c6c7.tar
nixos-08414045a56517d95e94f55c406ec8940336c6c7.tar.gz
nixos-08414045a56517d95e94f55c406ec8940336c6c7.tar.bz2
nixos-08414045a56517d95e94f55c406ec8940336c6c7.tar.xz
nixos-08414045a56517d95e94f55c406ec8940336c6c7.zip
...
Diffstat (limited to 'accounts/gkleen@sif/niri')
-rw-r--r--accounts/gkleen@sif/niri/default.nix8
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