2022-11-22 17:53:53 -05:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
import i3ipc
|
2022-11-22 20:37:27 -05:00
|
|
|
from os import system
|
|
|
|
#This script allows for sounds in i3
|
2022-11-22 17:53:53 -05:00
|
|
|
|
|
|
|
|
2022-11-22 18:25:06 -05:00
|
|
|
|
2022-11-22 20:37:27 -05:00
|
|
|
def on_new_window(self,i3):
|
|
|
|
system('play -n synth .25 sin 440:880 sin 480:920 remix - norm -3 pitch -500')
|
2022-11-22 18:25:06 -05:00
|
|
|
|
2022-11-22 20:37:27 -05:00
|
|
|
def on_mode(self,i3):
|
2022-11-23 16:10:22 -05:00
|
|
|
# mode = i3ipc.ModeEvent(['change'])
|
|
|
|
# if mode == 'resize':
|
|
|
|
system('play -qV0 "|sox -np synth .07 sq 400" "|sox -np synth .5 sq 800" fade h 0 .5 .5 norm -20')
|
|
|
|
# elif mode == 'default':
|
|
|
|
# system('play -qV0 "|sox -np synth .07 sq 400" "|sox -np synth .5 sq 800" fade h 0 .5 .5 norm -20 reverse')
|
2022-11-22 18:25:06 -05:00
|
|
|
|
2022-11-22 17:53:53 -05:00
|
|
|
i3 = i3ipc.Connection()
|
|
|
|
|
2022-11-22 20:37:27 -05:00
|
|
|
i3.on('window::new', on_new_window)
|
|
|
|
i3.on('mode', on_mode)
|
2022-11-22 21:11:29 -05:00
|
|
|
# get current mode:
|
|
|
|
# var = i3ipc.ModeEvent(data)
|
2022-11-22 17:53:53 -05:00
|
|
|
|
|
|
|
i3.main()
|