Added working sound script.
This commit is contained in:
parent
49601a56be
commit
12e6b4b664
@ -1,24 +1,19 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import i3ipc
|
||||
from os import system
|
||||
#This script allows for sounds in i3
|
||||
|
||||
|
||||
import os
|
||||
import i3ipc
|
||||
|
||||
|
||||
# sound command dictionary
|
||||
sounds = {'newWindow': 'play -n synth .25 sin 440:880 sin 480:920 remix - norm -3 pitch -500',
|
||||
'modeKey': 'play -qV0 "|sox -np synth .07 sq 400" "|sox -np synth .5 sq 800" fade h 0 .5 .5 norm -20',
|
||||
'modeDefaultKey': 'play -qV0 "|sox -np synth .07 sq 400" "|sox -np synth .5 sq 800" fade h 0 .5 .5 norm -20 reverse'}
|
||||
|
||||
def play_sound(event, sounds = sounds):
|
||||
os.system(sounds[event])
|
||||
|
||||
def on_new_window(self,i3):
|
||||
system('play -n synth .25 sin 440:880 sin 480:920 remix - norm -3 pitch -500')
|
||||
|
||||
def on_mode(self,i3):
|
||||
system('play -qV0 "|sox -np synth .07 sq 400" "|sox -np synth .5 sq 800" fade h 0 .5 .5 norm -20')
|
||||
|
||||
i3 = i3ipc.Connection()
|
||||
|
||||
i3.on('window::new', play_sound("newWindow"))
|
||||
i3.on('window::new', on_new_window)
|
||||
i3.on('mode', on_mode)
|
||||
|
||||
i3.main()
|
||||
|
Loading…
Reference in New Issue
Block a user