summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2024-03-08 14:21:27 -0800
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2024-03-08 14:21:27 -0800
commit5dd09b56750552463af37e71aed18bb2e32c8900 (patch)
tree101a656538917290629f10bafe911b98cd40e47a
parenta01e01dc8281403bb37211d6f2f8c1071441e401 (diff)
downloadpanel-5dd09b56750552463af37e71aed18bb2e32c8900.tar.gz
panel-5dd09b56750552463af37e71aed18bb2e32c8900.tar.xz
make volume adjustment step configurable
-rwxr-xr-xpanel.py7
1 files changed, 4 insertions, 3 deletions
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))))