fix 'sink not found' for pamixer

This commit is contained in:
2021-04-04 12:36:35 +02:00
parent c54817edc2
commit 8c4a6a495c

View File

@@ -20,7 +20,9 @@ def process(args):
def volume(name):
result = process(f'pamixer --get-volume --sink "{name}"')
if search("pamixer: command not found", result) is not None:
if search("The sink doesn't exit", result):
result = "--"
elif search("pamixer: command not found", result) is not None:
n = process(r"pactl list sinks short | awk '{print $2}'").split()
v = process(r"pactl list sinks | grep '^[[:space:]]Volume:' | sed -e 's,.* \([0-9][0-9]*\)%.*,\1,'").split()
if name in n: