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.

This commit is contained in:
stormdragon2976 2022-11-30 02:25:23 -05:00
parent 3b4f76df02
commit 70acde96ea
3 changed files with 37 additions and 11 deletions

20
i38.sh
View File

@ -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"

25
scripts/announce_workspace.sh Executable file
View File

@ -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}"

View File

@ -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 &')