mpd and title
This commit is contained in:
parent
8867f4f188
commit
e5cdabcc0f
2 changed files with 14 additions and 1 deletions
|
@ -94,6 +94,12 @@ class Module(core.module.Module):
|
|||
"cmd": "mpc toggle" + self._hostcmd,
|
||||
}
|
||||
widget.full_text(self.description)
|
||||
elif widget_name == "mpd.toggle":
|
||||
widget_map[widget] = {
|
||||
"button": core.input.LEFT_MOUSE,
|
||||
"cmd": "mpc toggle" + self._hostcmd,
|
||||
}
|
||||
widget.full_text(self.toggle)
|
||||
elif widget_name == "mpd.next":
|
||||
widget_map[widget] = {
|
||||
"button": core.input.LEFT_MOUSE,
|
||||
|
@ -127,6 +133,9 @@ class Module(core.module.Module):
|
|||
def description(self, widget):
|
||||
return string.Formatter().vformat(self._fmt, (), self._tags)
|
||||
|
||||
def toggle(self, widget):
|
||||
return str(util.cli.execute("mpc status %currenttime%/%totaltime%", ignore_errors=True)).strip()
|
||||
|
||||
def update(self):
|
||||
self._load_song()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue