From 96fa9c3f3ae54794f25f13ce5513408a49fbfdc1 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Fri, 25 Nov 2022 02:35:58 -0500 Subject: [PATCH] Window list bound to apostrophe in ratpoison mode. --- README.md | 2 ++ i38.sh | 2 ++ scripts/window_list.sh | 10 ++++++++++ 3 files changed, 14 insertions(+) create mode 100755 scripts/window_list.sh diff --git a/README.md b/README.md index dd824d2..c8e33e6 100644 --- a/README.md +++ b/README.md @@ -21,5 +21,7 @@ An uppercase I looks like a 1, 3 from i3, and 8 because the song [We Are 138](ht - libnotify: For sending notifications - notification-daemon: To handle notifications - pamixer: for the mute-unmute script +- jq: for getting window titles +- yad: For screen reader accessible dialogs I38 will try to detect your browser, file manager, and web browser and present you with a list of options to bind to their launch keys. It will also create bindings for pidgin and mumble if they are installed. To use the bindings, press your ratpoison mode key which is set when you run the i38.sh script. next, press the binding for the application you want, w for web browser, e for text editor, f for file manager, m for mumble, etc. To learn all the bindings, find and read the mode ratpoison section of ~/.config/i3/config. diff --git a/i38.sh b/i38.sh index 285d5a4..733d574 100755 --- a/i38.sh +++ b/i38.sh @@ -353,6 +353,8 @@ fi) $(if command -v transfersh &> /dev/null ; then echo 'bindsym t exec bash -c '"'"'fileName="$(yad --title "I38 Upload File" --file)" && url="$(transfersh "${fileName}" | tee >(yad --title "I38 - Uploading ${fileName##*/} ..." --progress --pulsate --auto-close))" && echo "${url#*saved at: }" | tee >(yad --title "I38 - Upload URL" --show-cursor --show-uri --button yad-close --sticky --text-info) >(xclip -selection clipboard)'"', mode \"default\"" fi) +# Get a list of windows in the current workspace +bindsym apostrophe exec --no-startup-id ${i3Path}/scripts/window_list.sh # Restart orca bindsym Shift+o exec $(command -v orca) --replace, mode "default" # reload the configuration file diff --git a/scripts/window_list.sh b/scripts/window_list.sh new file mode 100755 index 0000000..37b765b --- /dev/null +++ b/scripts/window_list.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +select_window() { + local window="$(yad --list --column "Select Window" "$@")" + echo "${window%|}" +} + +i3-msg '[title="'$(i3-msg -t get_tree | jq -r "recurse(.nodes[]) | select(.window) | .name" | select_window)'"] focus' + +exit 0