mpd widget and ncmpcpp drop

This commit is contained in:
crater2150 2011-05-10 20:59:47 +02:00
parent 396332a485
commit 62f91ecd03
2 changed files with 27 additions and 1 deletions

View file

@ -88,6 +88,7 @@ globalkeys = awful.util.table.join(
awful.key({ }, "XF86AudioPrev", function () awful.util.spawn("mpc prev") end),
awful.key({ }, "XF86AudioStop", function () awful.util.spawn("mpdmenu -a") end),
awful.key({ modkey , "Control" }, "n", function () awful.util.spawn("mpdmenu -j") end),
awful.key({ modkey }, "`", function () teardrop("urxvtc -e ncmpcpp","bottom","center", 0.99, 0.4)end ),
--}}}

View file

@ -28,6 +28,31 @@ clock = widget({ type = "textbox" })
vicious.register(clock, vicious.widgets.date, "%b %d, %R", 60)
-- music widget {{{
mpdwidget = widget({ type = "textbox" })
vicious.register(mpdwidget, vicious.widgets.mpd,
function(widget, args)
if args["{state}"] == "N/A" then
return ""
else
return "[ ♫ "..args["{Artist}"].." - "..args["{Title}"].." ]"
end
end, 3, {nil, os.getenv("MPD_HOST"), os.getenv("MPD_PORT")})
mpdwidget:buttons(awful.util.table.join(
awful.button({ }, 1, function () teardrop("urxvtc -e ncmpcpp","top","center", 0.99, 0.4)end )
))
mpdnext = widget({ type = "textbox" })
mpdnext.text = ""
mpdnext:buttons(awful.util.table.join(
awful.button({ }, 1, function () awful.util.spawn("mpc next") end)
))
mpdprev = widget({ type = "textbox" })
mpdprev.text = ""
mpdprev:buttons(awful.util.table.join(
awful.button({ }, 1, function () awful.util.spawn("mpc prev") end)
))
-- }}}
-- mail widget {{{
mailwidget = widget({ type = "textbox" })
@ -53,7 +78,6 @@ vicious.register(mailwidget, vicious.widgets.mdir,
end, 181, {os.getenv("HOME") .. "/.maildir/"})
--}}}
-- battery {{{
if exists("/proc/acpi/battery/BAT0") then
batwidget0 = widget({ type = "textbox" })
@ -163,6 +187,7 @@ for s = 1, screen.count() do
batwidget2,
wlanwidget,
spacer, cpulabel, cpuwidget,
spacer, mpdwidget, mpdnext, spacer, mpdprev,
spacer,
layout = awful.widget.layout.horizontal.leftright
},