Browse Source

initial commit

master
cinnaboot 7 years ago
commit
5082aaae0c
  1. 1
      .gitignore
  2. 6
      .gitmodules
  3. 1
      lib/powermate
  4. 1
      lib/python_pulse_control
  5. 35
      powermate_pactl.py

1
.gitignore vendored

@ -0,0 +1 @@
__pycache__/

6
.gitmodules vendored

@ -0,0 +1,6 @@
[submodule "lib/powermate"]
path = lib/powermate
url = https://github.com/bethebunny/powermate
[submodule "lib/python_pulse_control"]
path = lib/python_pulse_control
url = https://github.com/mk-fg/python-pulse-control

1
lib/powermate

@ -0,0 +1 @@
Subproject commit d7b6628b10171a6f5245ff9c9a6b57fe5cc4766e

1
lib/python_pulse_control

@ -0,0 +1 @@
Subproject commit 902d5e9e5591b89c356e5194a370212e23fb0e93

35
powermate_pactl.py

@ -0,0 +1,35 @@
#!/usr/bin/python
import glob
from lib.powermate import powermate
from lib.python_pulse_control.pulsectl import pulsectl
INCREASE_AMOUNT = 0.01
class PowerMate(powermate.PowerMateBase):
def __init__(self, path):
self.pulse = pulsectl.Pulse()
super().__init__(path)
def rotate(self, rotation):
#print(rotation);
if (rotation > 0):
self.change_vol(INCREASE_AMOUNT)
else:
self.change_vol(-INCREASE_AMOUNT)
def change_vol(self, vol):
for sink in self.pulse.sink_list():
#print(sink)
self.pulse.volume_change_all_chans(sink, vol)
if __name__ == '__main__':
pm = PowerMate(glob.glob('/dev/input/by-id/*PowerMate*')[0])
pm.run()
Loading…
Cancel
Save