]> git.rmz.io Git - dotfiles.git/blobdiff - awesome/widgets/mpd_widget.lua
awesome: support widget for missing title and file
[dotfiles.git] / awesome / widgets / mpd_widget.lua
index 1d011cf5cde5b2b80bee0365e84622efae4d3ae4..9a698f76cabf62784b304152a535768c0a7934d7 100644 (file)
@@ -26,10 +26,12 @@ function widget:update_widget()
     local artist = self._currentsong.artist
     local title = self._currentsong.title
     local file = self._currentsong.file
-    if not artist then
+    if artist and title then
+        text = string.format("%s - %s", artist, title)
+    elseif title or file then
         text = string.format("%s", title or file )
     else
-        text = string.format("%s - %s", artist, title)
+        text = "-"
     end
     self._textbox.text = text
 end