This commit is contained in:
Never Gude 2026-03-26 23:10:37 +01:00
parent 7f859b3305
commit 62df19e39f
7 changed files with 30 additions and 9 deletions

21
.local/scripts/windowmenu.fish Executable file
View file

@ -0,0 +1,21 @@
#!/usr/bin/env fish
set windows
# while read i; do
# declare -a line_array="($i)"
# window_ids+=(${line_array[0]})
# window_titles+=("${line_array[1]} - ${line_array[2]} \0icon\x1f${line_array[1]}")
# done <<<$(niri msg --json windows | jq -r '.[] | [ .id, .app_id, .title] | "\""+join ("\" \"")+"\""')
#
set windows (niri msg --json windows | jq -r '.[] | [ .id, .app_id, .title] | join(" ")')
set ids (string split --max 2 --field 1 " " $windows)
for window in $windows
set -a options (string join -- ' ' (string split --max 1 --fields 2 ' ' $window) "\0icon\x1f$(string split --max 2 --field 2 ' ' $window)" )
end
set input (menu --index $options)
niri msg action focus-window --id $ids[(math "$input+1")]