diff --git a/bumblebee/modules/cmus.py b/bumblebee/modules/cmus.py index f2dfea3..b58d47f 100644 --- a/bumblebee/modules/cmus.py +++ b/bumblebee/modules/cmus.py @@ -22,6 +22,9 @@ class Module(bumblebee.engine.Module): ] super(Module, self).__init__(engine, config, widgets) self._fmt = self.parameter("format", "{artist} - {title} {position}/{duration}") + self._status = None + self._shuffle = False + self._repeat = False def description(self): return string.Formatter().vformat(self._fmt, (), self._tags) @@ -29,6 +32,17 @@ class Module(bumblebee.engine.Module): def update(self, widgets): self._load_song() + def state(self, widget): + if widget.name == "cmus.shuffle": + return "shuffle-on" if self._shuffle else "shuffle-off" + if widget.name == "cmus.repeat": + return "repeat-on" if self._repeat else "repeat-off" + if widget.name == "cmus.prev": + return "prev" + if widget.name == "cmus.next": + return "next" + return self._status + def _load_song(self): info = "" try: diff --git a/themes/icons/awesome-fonts.json b/themes/icons/awesome-fonts.json index 3424710..c019337 100644 --- a/themes/icons/awesome-fonts.json +++ b/themes/icons/awesome-fonts.json @@ -13,8 +13,10 @@ "stopped": { "prefix": "" }, "prev": { "prefix": "" }, "next": { "prefix": "" }, - "shuffle": { "on": { "prefix": "" }, "off": { "prefix": "" } }, - "repeat": { "on": { "prefix": "" }, "off": { "prefix": "" } } + "shuffle-on": { "prefix": "" }, + "shuffle-off": { "prefix": "" }, + "repeat-on": { "prefix": "" }, + "repeat-off": { "prefix": "" } }, "pasink": { "muted": { "prefix": "" },