Merge pull request #58 from hramezani/mpd_not_running

Set `MPD is not running` in mpdarc-widget current song when MPD is no…
This commit is contained in:
streetturtle 2018-11-06 15:45:08 -05:00 committed by GitHub
commit 63d1f63129
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -70,10 +70,14 @@ local update_graphic = function(widget, stdout, _, _, _)
mpdarc_current_song_widget.markup = current_song
else
icon.image = STOP_ICON_NAME
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
mpdarc:connect_signal("button::press", function(_, _, _, button)
if (button == 1) then awful.spawn(TOGGLE_MPD_CMD, false) -- left click