[modules] Re-enable preconfigured on-click actions

This commit is contained in:
Tobias Witek 2016-11-05 15:28:33 +01:00
parent c821deec1c
commit 26f5fd3064
7 changed files with 51 additions and 41 deletions

View file

@ -36,15 +36,14 @@ class Module(bumblebee.module.Module):
self._mute = False
channel = "sink" if self._module == "pasink" else "source"
# TODO
# output.add_callback(module=self.__module__, button=3,
# cmd="pavucontrol")
# output.add_callback(module=self.__module__, button=1,
# cmd="pactl set-{}-mute @DEFAULT_{}@ toggle".format(channel, channel.upper()))
# output.add_callback(module=self.__module__, button=4,
# cmd="pactl set-{}-volume @DEFAULT_{}@ +2%".format(channel, channel.upper()))
# output.add_callback(module=self.__module__, button=5,
# cmd="pactl set-{}-volume @DEFAULT_{}@ -2%".format(channel, channel.upper()))
output.add_callback(module=self.instance(), button=3,
cmd="pavucontrol")
output.add_callback(module=self.instance(), button=1,
cmd="pactl set-{}-mute @DEFAULT_{}@ toggle".format(channel, channel.upper()))
output.add_callback(module=self.instance(), button=4,
cmd="pactl set-{}-volume @DEFAULT_{}@ +2%".format(channel, channel.upper()))
output.add_callback(module=self.instance(), button=5,
cmd="pactl set-{}-volume @DEFAULT_{}@ -2%".format(channel, channel.upper()))
def widgets(self):
res = subprocess.check_output(shlex.split("pactl info"))