new version of window_list.sh. Hopefully it works better than the previous version. It now uses window ID instead of title to set the focus.

This commit is contained in:
stormdragon2976 2022-11-30 03:35:35 -05:00
parent db9c7732c4
commit 3d3fa8de95

View File

@ -1,10 +1,16 @@
#!/usr/bin/env bash
select_window() {
local window="$(yad --list --column "Select Window" "$@")"
echo "${window%|}"
}
mapfile -t windowList < <(python3 -c '
import i3ipc
i3-msg '[title="'$(i3-msg -t get_tree | jq -r "recurse(.nodes[]) | select(.window) | .name" | select_window)'"] focus'
i3 = i3ipc.Connection()
for con in i3.get_tree():
if con.window and con.parent.type != "dockarea":
print(con.window)
print(con.name)')
id="$(yad --title "I38" --list --separator "" --column "id" --column "Select Window" --hide-column 1 --print-column 1 "${windowList[@]}")"
if [[ -z "${id}" ]]; then
exit 0
fi
i3-msg \[id="${id}"\] focus