[modules/cmus] Add mouse controls
Enable play/pause, repeat/shuffle toggle, next/prev song by clicking on the various elements in the bar. see #23
This commit is contained in:
parent
1a3217bb5f
commit
b1ec41f905
1 changed files with 12 additions and 0 deletions
|
@ -21,6 +21,18 @@ class Module(bumblebee.engine.Module):
|
|||
bumblebee.output.Widget(name="cmus.repeat"),
|
||||
]
|
||||
super(Module, self).__init__(engine, config, widgets)
|
||||
|
||||
engine.input.register_callback(widgets[0], button=bumblebee.input.LEFT_MOUSE,
|
||||
cmd="cmus-remote -r")
|
||||
engine.input.register_callback(widgets[1], button=bumblebee.input.LEFT_MOUSE,
|
||||
cmd="cmus-remote -u")
|
||||
engine.input.register_callback(widgets[2], button=bumblebee.input.LEFT_MOUSE,
|
||||
cmd="cmus-remote -n")
|
||||
engine.input.register_callback(widgets[3], button=bumblebee.input.LEFT_MOUSE,
|
||||
cmd="cmus-remote -S")
|
||||
engine.input.register_callback(widgets[4], button=bumblebee.input.LEFT_MOUSE,
|
||||
cmd="cmus-remote -R")
|
||||
|
||||
self._fmt = self.parameter("format", "{artist} - {title} {position}/{duration}")
|
||||
self._status = None
|
||||
self._shuffle = False
|
||||
|
|
Loading…
Reference in a new issue