From d20a1ef4a49788984e9fa0b30daff09e04e88c4c Mon Sep 17 00:00:00 2001 From: Jeremiah Ticket Date: Sat, 26 Nov 2022 21:30:15 -0700 Subject: [PATCH] Added sounds and corrected exit bindsym --- i38.sh | 2 +- scripts/sound.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/i38.sh b/i38.sh index 1792420..f8fbd96 100755 --- a/i38.sh +++ b/i38.sh @@ -381,7 +381,7 @@ bindsym Control+semicolon exec bash -c 'i3-msg -t run_command reload && spd-say # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) bindsym Control+Shift+semicolon exec bash -c 'i3-msg -t run_command restart && spd-say -P important -Cw "I3 restarted."', mode "default" # exit i3 (logs you out of your X session) -bindsym Control+q exec bash -c 'yad --image "dialog-question" --title "I38" --button=yes:0 --button=no:1 --text "You pressed the exit shortcut. Do you really want to exit i3? This will end your X session." && i3-msg -t exit i3' +bindsym Control+q exec bash -c 'yad --image "dialog-question" --title "I38" --button=yes:0 --button=no:1 --text "You pressed the exit shortcut. Do you really want to exit i3? This will end your X session." && i3-msg -t run_command exit' bindsym Escape mode "default" } diff --git a/scripts/sound.py b/scripts/sound.py index 9540bd5..21f41f3 100755 --- a/scripts/sound.py +++ b/scripts/sound.py @@ -28,11 +28,19 @@ def on_workspace_move(self,i3): def on_restart(self,i3): system('play -qn synth .25 saw 500:1200 fade .1 .25 .1 norm -8 &') +def on_exit(self,i3): + system('play -qn synth .3 sin 700:200 fade 0 .3 0 &') + +def on_fullscreen(self,i3): + system('play -qn synth br flanger fade h .3 .3 0 &') + i3 = i3ipc.Connection() i3.on('window::new', on_new_window) i3.on(Event.MODE, on_mode) i3.on('workspace::focus', on_workspace_focus) i3.on('window::move', on_workspace_move) +i3.on('window::fullscreen_mode', on_fullscreen) i3.on('shutdown::restart', on_restart) +i3.on('shutdown::exit', on_exit) i3.main()