From 6b483981d9eefdbf5671fbb65ef31c71ddd75dde Mon Sep 17 00:00:00 2001 From: Lars Vierbergen Date: Sun, 22 Jan 2017 20:22:43 +0100 Subject: [PATCH] Only apply volume control to default sink --- modules/volume.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/modules/volume.py b/modules/volume.py index e2396b9..517b609 100644 --- a/modules/volume.py +++ b/modules/volume.py @@ -129,15 +129,10 @@ class PaCtlVolumeControl(AbstractVolumeControl): logger.exception("Error setting mute") return False - def _pa_get_sinks(self): - return [l.split(b'\t')[0].decode() for l in - subprocess.check_output(["pactl", "list", "short", "sinks"], stdin=subprocess.DEVNULL, - stderr=subprocess.DEVNULL).split(b'\n') if len(l) > 0] - def _pactl(self, command, arg): - for i in self._pa_get_sinks(): - logger.debug("Calling pactl: %s %s %s", command, i, arg) - subprocess.check_call(["pactl", command, i, arg], stdin=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + logger.debug("Calling pactl: %s %s %s", command, '@DEFAULT_SINK@', arg) + subprocess.check_call(["pactl", command, '@DEFAULT_SINK@', arg], stdin=subprocess.DEVNULL, + stderr=subprocess.DEVNULL) try: