From 8c4a6a495c5575335e53161bdccf733cf1220173 Mon Sep 17 00:00:00 2001 From: Daniel Weschke Date: Sun, 4 Apr 2021 12:36:35 +0200 Subject: [PATCH] fix 'sink not found' for pamixer --- controldeck.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/controldeck.py b/controldeck.py index f3dd40f..13c36df 100644 --- a/controldeck.py +++ b/controldeck.py @@ -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: