[modules] Re-enable preconfigured on-click actions
This commit is contained in:
parent
c821deec1c
commit
26f5fd3064
7 changed files with 51 additions and 41 deletions
|
@ -15,9 +15,7 @@ class Module(bumblebee.module.Module):
|
|||
super(Module, self).__init__(output, config, alias)
|
||||
self._perc = psutil.cpu_percent(percpu=False)
|
||||
|
||||
# TODO
|
||||
# output.add_callback(module=self.__module__, button=1,
|
||||
# cmd="gnome-system-monitor")
|
||||
output.add_callback(module=self.instance(), button=1, cmd="gnome-system-monitor")
|
||||
|
||||
def widgets(self):
|
||||
self._perc = psutil.cpu_percent(percpu=False)
|
||||
|
|
|
@ -16,9 +16,7 @@ class Module(bumblebee.module.Module):
|
|||
super(Module, self).__init__(output, config, alias)
|
||||
self._path = self._config.parameter("path", "/")
|
||||
|
||||
# TODO
|
||||
# output.add_callback(module=self.__module__, button=1,
|
||||
# cmd="nautilus {instance}")
|
||||
output.add_callback(module=self.instance(), button=1, cmd="nautilus {instance}")
|
||||
|
||||
def widgets(self):
|
||||
st = os.statvfs(self._path)
|
||||
|
@ -33,6 +31,9 @@ class Module(bumblebee.module.Module):
|
|||
bumblebee.util.bytefmt(self._size), self._perc)
|
||||
)
|
||||
|
||||
def instance(self, widget=None):
|
||||
return self._path
|
||||
|
||||
def warning(self, widget):
|
||||
return self._perc > self._config.parameter("warning", 80)
|
||||
|
||||
|
|
|
@ -16,9 +16,7 @@ class Module(bumblebee.module.Module):
|
|||
super(Module, self).__init__(output, config, alias)
|
||||
self._mem = psutil.virtual_memory()
|
||||
|
||||
# TODO
|
||||
# output.add_callback(module=self.__module__, button=1,
|
||||
# cmd="gnome-system-monitor")
|
||||
output.add_callback(module=self.instance(), button=1, cmd="gnome-system-monitor")
|
||||
|
||||
def widgets(self):
|
||||
self._mem = psutil.virtual_memory()
|
||||
|
|
|
@ -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"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue