From 92a9d57c05edb6adea2a7105ea95573c602f8737 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Tue, 14 May 2024 23:35:55 -0400 Subject: [PATCH] Notification sound if using xfce4-notifyd. --- scripts/sound.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/sound.py b/scripts/sound.py index 85523f2..41fa53c 100755 --- a/scripts/sound.py +++ b/scripts/sound.py @@ -10,10 +10,14 @@ i3 = i3ipc.Connection() def on_new_window(self,i3): - system('play -n synth .25 sin 440:880 sin 480:920 remix - norm -3 pitch -500 &') + if i3.container.name == 'xfce4-notifyd': + system('play -n synth .05 sq 1800 tri 2400 delay 0 .03 remix - repeat 2 echo .55 0.7 20 1 norm -12 &') + else: + system('play -n synth .25 sin 440:880 sin 480:920 remix - norm -3 pitch -500 &') def on_close_window(self,i3): - system('play -n synth .25 sin 880:440 sin 920:480 remix - norm -3 pitch -500 &') + if i3.container.name != 'xfce4-notifyd': + system('play -n synth .25 sin 880:440 sin 920:480 remix - norm -3 pitch -500 &') def on_mode(self,event): mode= event.change