summaryrefslogtreecommitdiff
path: root/panel.py
diff options
context:
space:
mode:
Diffstat (limited to 'panel.py')
-rwxr-xr-xpanel.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/panel.py b/panel.py
index 4c9decd..59d4874 100755
--- a/panel.py
+++ b/panel.py
@@ -478,7 +478,22 @@ class ModPWVol(ModInterval):
buf += ' [muted]'
else:
buf = Fmt.bg('#a03000', ' error ')
- self.out = Fmt.labelled('VOL', buf)
+
+ self.out = Fmt.clickable(
+ 4, f'{id(self)} set 0.05+',
+ Fmt.clickable(
+ 5, f'{id(self)} set 0.05-',
+ Fmt.clickable(
+ '', f'{id(self)} toggle-mute',
+ Fmt.labelled('VOL', buf))))
+
+ def process_cmd(self, cmd):
+ if cmd == 'toggle-mute':
+ subprocess.run(('wpctl', 'set-mute', self.sink, 'toggle'))
+ elif cmd.startswith('set'):
+ subprocess.run(('wpctl', 'set-volume', self.sink, cmd[4:]))
+ self.refresh()
+ self.repaint()
class Panel:
def __init__(self, *mods, max_paint_delay=0, width=1920, height=22):