]> git.madduck.net Git - etc/awesome.git/blobdiff - widgets/mpd.lua

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

readme updated
[etc/awesome.git] / widgets / mpd.lua
index 9a9c28ee2191e99d83d566d22e362584ebe9a327..8db62ae365af9561bc9fc3e20189127e37beb4c6 100644 (file)
@@ -36,6 +36,7 @@ function worker(args)
     local header_color = args.header_color or beautiful.fg_normal or "#FFFFFF"
     local color = args.color or beautiful.fg_focus or "#FFFFFF"
     local spr = args.spr or " "
+    local footer = args.footer or ""
     local app = args.app or "ncmpcpp"
     local shadow = args.shadow or false
 
@@ -53,7 +54,7 @@ function worker(args)
             then
                 mympd:set_text('')
             else
-                mympd:set_markup(markup(header_color, " mpd "), markup(color , "off "))
+                mympd:set_markup(markup(header_color, "mpd ") .. markup(color , "off") .. footer)
             end
         end
 
@@ -102,14 +103,14 @@ function worker(args)
                     replaces_id = mpd.id
                 }).id
             end
-            mympd:set_markup(markup(header_color, " " .. mpd_state["{Artist}"])
+            mympd:set_markup(markup(header_color, mpd_state["{Artist}"])
                              .. spr ..
-                             markup(color, mpd_state["{Title}"] .. " "))
+                             markup(color, mpd_state["{Title}"]) .. footer)
         elseif mpd_state["{state}"] == "pause"
         then
-            mympd:set_markup(markup(header_color, " mpd")
+            mympd:set_markup(markup(header_color, "mpd")
                              .. spr ..
-                             markup(color, "paused "))
+                             markup(color, "paused") .. footer)
         else
             helpers.set_map("current mpd track", nil)
                        set_nompd()