[mpd] Add color setting

This commit is contained in:
Naglis Jonaitis 2014-07-18 00:08:03 +03:00
parent a2995a71a7
commit 1a762b9afe

View File

@ -30,7 +30,8 @@ class MPD(IntervalModule):
("host"), ("host"),
("port", "MPD port"), ("port", "MPD port"),
("format", "formatp string"), ("format", "formatp string"),
("status", "Dictionary mapping pause, play and stop to output") ("status", "Dictionary mapping pause, play and stop to output"),
("color", "The color of the text"),
) )
host = "localhost" host = "localhost"
@ -43,6 +44,7 @@ class MPD(IntervalModule):
"play": "", "play": "",
"stop": "", "stop": "",
} }
color = "#FFFFFF"
vol = 100 vol = 100
@ -88,9 +90,11 @@ class MPD(IntervalModule):
} }
self.output = { self.output = {
"full_text": formatp(self.format, **fdict).strip(), "full_text": formatp(self.format, **fdict).strip(),
"color": self.color,
} }
except Exception as e: except Exception as e:
self.output = {"full_text": "error connecting MPD"} self.output = {"full_text": "error connecting MPD",
"color": self.color}
def on_leftclick(self): def on_leftclick(self):
try: try: