misaka

alsaget

Mar 30th, 2013
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. #!/usr/bin/python2
  2. #ln -sf alsaget.py /usr/bin/alsaget
  3. import sys
  4. import alsaaudio
  5. arg = sys.argv[1]
  6. mixer = alsaaudio.Mixer("Master")
  7. def get_volume():
  8.     volume = int(mixer.getvolume()[0])
  9.     print volume
  10. def get_mute():
  11.     mute = int(mixer.getmute()[0])
  12.     print mute
  13. functions = {"volume": get_volume, "mute": get_mute}
  14. functions[arg]()
Advertisement
Add Comment
Please, Sign In to add comment