cmus - Allow changing of output when cmus is not running

This closes enkore/i3pystatus#226
This commit is contained in:
Raphael Scholer 2015-08-19 07:51:52 +02:00
parent 2b12fb6fe7
commit 1f97408709

View File

@ -31,12 +31,14 @@ class Cmus(IntervalModule):
settings = ( settings = (
('format', 'formatp string'), ('format', 'formatp string'),
('format_not_running', 'Text to show if cmus is not running'),
('color', 'The color of the text'), ('color', 'The color of the text'),
('status', 'Dictionary mapping status to output'), ('status', 'Dictionary mapping status to output'),
) )
color = '#909090' color = '#909090'
format = '{status} {song_elapsed}/{song_length} {artist} - {title}' format = '{status} {song_elapsed}/{song_length} {artist} - {title}'
format_not_running = 'Not running'
interval = 1 interval = 1
status = { status = {
'paused': '', 'paused': '',
@ -71,7 +73,7 @@ class Cmus(IntervalModule):
def run(self): def run(self):
self.output = { self.output = {
'full_text': 'Not running', 'full_text': self.format_not_running,
'color': self.color 'color': self.color
} }
response = self._query_cmus() response = self._query_cmus()