From 143d299a329a2c484bd1dd0b01bbc69a5aa39d99 Mon Sep 17 00:00:00 2001 From: Jeremiah Ticket Date: Tue, 29 Nov 2022 22:57:02 -0700 Subject: [PATCH 1/3] Fixed Control+space ratpoison key --- i38.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i38.sh b/i38.sh index 8f539ec..a11818f 100755 --- a/i38.sh +++ b/i38.sh @@ -145,7 +145,7 @@ while getopts "${args}" i ; do done # Configuration questions -escapeKey="$(menulist "Ratpoison mode key:" Control+t Control+z Control+Escape Alt+Escape Control+Space Super)" +escapeKey="$(menulist "Ratpoison mode key:" Control+t Control+z Control+Escape Alt+Escape Control+space Super)" escapeKey="${escapeKey//Alt/Mod1}" escapeKey="${escapeKey//Super/Mod4}" mod="$(menulist "I3 mod key, for top level bindings:" Alt Control Super)" From 70acde96ea40b9d33027fb1a86525b889bbaf19f Mon Sep 17 00:00:00 2001 From: stormdragon2976 Date: Wed, 30 Nov 2022 02:25:23 -0500 Subject: [PATCH 2/3] make a bit of ear candy for workspace movement. Commented out original event in sound.py, we can remove it once this is well tested. --- i38.sh | 20 ++++++++++---------- scripts/announce_workspace.sh | 25 +++++++++++++++++++++++++ scripts/sound.py | 3 ++- 3 files changed, 37 insertions(+), 11 deletions(-) create mode 100755 scripts/announce_workspace.sh diff --git a/i38.sh b/i38.sh index 8f539ec..91b1f10 100755 --- a/i38.sh +++ b/i38.sh @@ -322,16 +322,16 @@ set \$ws9 "9" set \$ws10 "10" # switch to workspace -bindsym Control+F1 workspace number \$ws1, exec spd-say -P important -Cw "workspace 1" -bindsym Control+F2 workspace number \$ws2, exec spd-say -P important -Cw "workspace 2" -bindsym Control+F3 workspace number \$ws3, exec spd-say -P important -Cw "workspace 3" -bindsym Control+F4 workspace number \$ws4, exec spd-say -P important -Cw "workspace 4" -bindsym Control+F5 workspace number \$ws5, exec spd-say -P important -Cw "workspace 5" -bindsym Control+F6 workspace number \$ws6, exec spd-say -P important -Cw "workspace 6" -bindsym Control+F7 workspace number \$ws7, exec spd-say -P important -Cw "workspace 7" -bindsym Control+F8 workspace number \$ws8, exec spd-say -P important -Cw "workspace 8" -bindsym Control+F9 workspace number \$ws9, exec spd-say -P important -Cw "workspace 9" -bindsym Control+F10 workspace number \$ws10, exec spd-say -P important -Cw "workspace 10" +bindsym Control+F1 workspace number \$ws1, exec --no-startup-id ${i3Path}/scripts/announce_workspace.sh +bindsym Control+F2 workspace number \$ws2, exec --no-startup-id ${i3Path}/scripts/announce_workspace.sh +bindsym Control+F3 workspace number \$ws3, exec --no-startup-id ${i3Path}/scripts/announce_workspace.sh +bindsym Control+F4 workspace number \$ws4, exec --no-startup-id ${i3Path}/scripts/announce_workspace.sh +bindsym Control+F5 workspace number \$ws5, exec --no-startup-id ${i3Path}/scripts/announce_workspace.sh +bindsym Control+F6 workspace number \$ws6, exec --no-startup-id ${i3Path}/scripts/announce_workspace.sh +bindsym Control+F7 workspace number \$ws7, exec --no-startup-id ${i3Path}/scripts/announce_workspace.sh +bindsym Control+F8 workspace number \$ws8, exec --no-startup-id ${i3Path}/scripts/announce_workspace.sh +bindsym Control+F9 workspace number \$ws9, exec --no-startup-id ${i3Path}/scripts/announce_workspace.sh +bindsym Control+F10 workspace number \$ws10, exec --no-startup-id ${i3Path}/scripts/announce_workspace.sh # move focused container to workspace bindsym Control+Shift+F1 move container to workspace number \$ws1, exec spd-say -P important -Cw "moved to workspace 1" diff --git a/scripts/announce_workspace.sh b/scripts/announce_workspace.sh new file mode 100755 index 0000000..cd62e5b --- /dev/null +++ b/scripts/announce_workspace.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +workSpace="$(i3-msg -t get_workspaces \ + | jq '.[] | select(.focused==true).name' \ + | cut -d"\"" -f2)" +left=9 +right=0 +msg="Workspace ${workSpace}" +if ! [[ "${workSpace}" =~ ^[0-9]+$ ]]; then + right=9 +else + if [[ ${workSpace} -eq 10 ]]; then + left=0 + right=9 + elif [[ ${workSpace} -eq 5 ]]; then + right=9 + elif [[ ${workSpace} -gt 5 ]]; then + right=9 + ((left-=${workSpace})) + else + ((right+=${workSpace})) + fi +fi +play -nqV0 synth pi fade 0 .25 .15 pad 0 1 reverb overdrive riaa norm -5 speed 1 remix v0.${left} v0.${right} & +spd-say -P important -Cw "${msg}" diff --git a/scripts/sound.py b/scripts/sound.py index 21f41f3..9fd3e28 100755 --- a/scripts/sound.py +++ b/scripts/sound.py @@ -20,7 +20,8 @@ def on_mode(self,event): system('play -qV0 "|sox -np synth .07 sq 400" "|sox -np synth .5 sq 800" fade h 0 .5 .5 norm -20 &') def on_workspace_focus(self,i3): - system('play -qnV0 synth pi fade 0 .25 .15 pad 0 1 reverb overdrive riaa norm -8 speed 1 &') + #system('play -qnV0 synth pi fade 0 .25 .15 pad 0 1 reverb overdrive riaa norm -8 speed 1 &') + pass def on_workspace_move(self,i3): system('play -qnV0 synth pi fade 0 .25 .15 pad 0 1 reverb overdrive riaa norm -8 speed 1 reverse &') From 3d3fa8de9503d61d738c38b999d02ec715161713 Mon Sep 17 00:00:00 2001 From: stormdragon2976 Date: Wed, 30 Nov 2022 03:35:35 -0500 Subject: [PATCH 3/3] 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. --- scripts/window_list.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/scripts/window_list.sh b/scripts/window_list.sh index 37b765b..fc837da 100755 --- a/scripts/window_list.sh +++ b/scripts/window_list.sh @@ -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() -exit 0 +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