From 5dd09b56750552463af37e71aed18bb2e32c8900 Mon Sep 17 00:00:00 2001 From: David Vazgenovich Shakaryan Date: Fri, 8 Mar 2024 14:21:27 -0800 Subject: make volume adjustment step configurable --- panel.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'panel.py') diff --git a/panel.py b/panel.py index 77a6a51..c518d74 100755 --- a/panel.py +++ b/panel.py @@ -465,9 +465,10 @@ class ModMem(ModInterval): self.out = Fmt.labelled('MEM', f'{percent:.0f}%%') class ModPWVol(ModInterval): - def __init__(self, sink='@DEFAULT_AUDIO_SINK@', **kwargs): + def __init__(self, sink='@DEFAULT_AUDIO_SINK@', step='0.05', **kwargs): super().__init__(**kwargs) self.sink = sink + self.step = step def refresh(self): res = subprocess.run( @@ -482,9 +483,9 @@ class ModPWVol(ModInterval): buf = Fmt.bg('#a03000', ' error ') self.out = Fmt.clickable( - 4, f'{id(self)} set 0.05+', + 4, f'{id(self)} set {self.step}+', Fmt.clickable( - 5, f'{id(self)} set 0.05-', + 5, f'{id(self)} set {self.step}-', Fmt.clickable( '', f'{id(self)} toggle-mute', Fmt.labelled('VOL', buf)))) -- cgit v1.2.3-70-g09d2