Files
I38/scripts/window_list.sh

28 lines
1.8 KiB
Bash
Executable File

#!/usr/bin/env bash
# This file is part of I38.
# I38 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation,
# either version 3 of the License, or (at your option) any later version.
# I38 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with I38. If not, see <https://www.gnu.org/licenses/>.
mapfile -t windowList < <(python3 -c '
import i3ipc
i3 = i3ipc.Connection()
for con in i3.get_tree():
if con.window and con.parent.type != "dockarea":
print(con.window)
print(f"{con.name} workspace {con.workspace().name}")')
id="$(yad --title "I38" --list --separator "" --column "id" --column "Select Window" --hide-column 1 --print-column 1 --search-column 2 "${windowList[@]}")"
if [[ -z "${id}" ]]; then
exit 0
fi
i3-msg \[id="${id}"\] focus