[modules/cmus] Add controls for cmus (next/prev/shuffle/repeat)

Add controls that allow the user to switch to the next and previous song
in cmus, toggle shuffle and repeat. Pause/play is toggled by clicking on
the song title itself.

fixes #5
This commit is contained in:
Tobi-wan Kenobi 2016-11-12 12:11:42 +01:00
parent a33cb1d7cb
commit dead54ed1f
7 changed files with 82 additions and 7 deletions

View file

@ -75,14 +75,20 @@ class Theme:
def _get(self, widget, name):
module = widget.module()
state = widget.state()
inst = widget.instance()
inst = inst.replace("{}.".format(module), "")
module_theme = self._data.get(module, {})
state_theme = module_theme.get("states", {}).get(state, {})
instance_theme = module_theme.get(inst, {})
instance_state_theme = instance_theme.get("states", {}).get(state, {})
value = None
value = self._defaults.get(name, value)
value = self._cycle.get(name, value)
value = module_theme.get(name, value)
value = state_theme.get(name, value)
value = instance_theme.get(name, value)
value = instance_state_theme.get(name, value)
if type(value) is list:
key = "{}{}".format(repr(widget), value)