From 944c00201a89dfaaa10632b9e3603ebecd174a30 Mon Sep 17 00:00:00 2001 From: Hasan Ramezani Date: Tue, 6 Nov 2018 21:42:27 +0100 Subject: [PATCH] Set `MPD is not running` in mpdarc-widget current song when MPD is not running. --- mpdarc-widget/mpdarc.lua | 8 ++++++-- 1 file 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