fix volume input sinks to handle also mono streams
This commit is contained in:
@@ -300,7 +300,11 @@ class Volume(Div):
|
|||||||
volume_level = 0
|
volume_level = 0
|
||||||
if self.pa_state: # might be empty {} if it is not found
|
if self.pa_state: # might be empty {} if it is not found
|
||||||
# pulseaudio 2^16 (65536) volume levels
|
# pulseaudio 2^16 (65536) volume levels
|
||||||
volume_level = float(self.pa_state['volume']['front-left']['value_percent'][:-1]) # remove the % sign
|
if 'front-left' in self.pa_state['volume']:
|
||||||
|
volume_level = float(self.pa_state['volume']['front-left']['value_percent'][:-1]) # remove the % sign
|
||||||
|
elif 'mono' in self.pa_state['volume']:
|
||||||
|
volume_level = float(self.pa_state['volume']['mono']['value_percent'][:-1]) # remove the % sign
|
||||||
|
# TODO: ? indicator if stream is stereo or mono ?
|
||||||
|
|
||||||
badge = QBadge(
|
badge = QBadge(
|
||||||
text=badge_name,
|
text=badge_name,
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ After=network.target
|
|||||||
[Service]
|
[Service]
|
||||||
Environment=PYTHONUNBUFFERED=1
|
Environment=PYTHONUNBUFFERED=1
|
||||||
TimeoutStartSec=30
|
TimeoutStartSec=30
|
||||||
ExecStartPre=/bin/sh -c 'source /etc/profile'
|
#ExecStartPre=/bin/sh -c 'source /etc/profile'
|
||||||
ExecStart=%h/.local/bin/controldeck -D
|
ExecStart=%h/.local/bin/controldeck -D
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=4
|
RestartSec=4
|
||||||
|
|||||||
Reference in New Issue
Block a user