summaryrefslogtreecommitdiff
path: root/mpdarc-widget
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@users.noreply.github.com>2018-11-06 15:45:08 -0500
committerGitHub <noreply@github.com>2018-11-06 15:45:08 -0500
commit63d1f63129ee7efd7edd89ab960cab40ad564abf (patch)
treecdda6e9068a545ed26c03feebdfc7c04199177bf /mpdarc-widget
parenta89e2fe76a2134cd473e98c94973267c59567771 (diff)
parent944c00201a89dfaaa10632b9e3603ebecd174a30 (diff)
Merge pull request #58 from hramezani/mpd_not_running
Set `MPD is not running` in mpdarc-widget current song when MPD is no…
Diffstat (limited to 'mpdarc-widget')
-rw-r--r--mpdarc-widget/mpdarc.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/mpdarc-widget/mpdarc.lua b/mpdarc-widget/mpdarc.lua
index da596f6..ca0f411 100644
--- a/mpdarc-widget/mpdarc.lua
+++ b/mpdarc-widget/mpdarc.lua
@@ -70,8 +70,12 @@ local update_graphic = function(widget, stdout, _, _, _)
mpdarc_current_song_widget.markup = current_song
else
icon.image = STOP_ICON_NAME
- widget.colors = { beautiful.widget_red }
- mpdarc_current_song_widget.markup = ""
+ if string.len(stdout) == 0 then -- MPD is not running
+ mpdarc_current_song_widget.markup = "MPD is not running"
+ else
+ widget.colors = { beautiful.widget_red }
+ mpdarc_current_song_widget.markup = ""
+ end
end
end