Skip to content

Commit

Permalink
Merge remote branch 'kstrauser/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
cortesi committed Mar 28, 2011
2 parents 2bb93a1 + 53ef6de commit 953f6ca
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions libqtile/widget/volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,15 @@ def setup_images(self):
self.surfaces[img_name] = imgpat

def get_volume(self):
from subprocess import check_output
mixer_out = check_output(['amixer', '-c', str(self.cardid),
'sget', self.channel])
import subprocess
mixerprocess = subprocess.Popen(['amixer', '-c', str(self.cardid),
'sget', self.channel],
stdout=subprocess.PIPE)
mixer_out = mixerprocess.communicate()[0]
if mixerprocess.returncode:
raise subprocess.CalledProcessError(mixerprocess.returncode,
'amixer')

if '[off]' in mixer_out:
return -1

Expand Down

0 comments on commit 953f6ca

Please sign in to comment.