From: martin f. krafft Date: Mon, 22 Apr 2013 12:01:28 +0000 (+0200) Subject: improve nyxmms current notification X-Git-Url: https://git.madduck.net/etc/awesome.git/commitdiff_plain/ceb861e54904a5c03354e3a6041b6574480b36b4 improve nyxmms current notification --- diff --git a/.config/awesome/rc.lua b/.config/awesome/rc.lua index 1bbe2d4..c558b8d 100644 --- a/.config/awesome/rc.lua +++ b/.config/awesome/rc.lua @@ -451,7 +451,9 @@ globalkeys = awful.util.table.join(globalkeys, awful.key({ cmdmodkey }, "space", function () awful.util.spawn("nyxmms2 toggle") end), awful.key({ cmdmodkey }, "backslash", function () local f = io.popen('nyxmms2 current', 'r') - naughty.notify({ title = "Now playing", text = string.sub(f:read(), 10), timeout = 5 }) + for s, t in string.gmatch(f:read(), '(%w+):%s+([^:]+)') do + naughty.notify({ title = s, text = t, timeout = 5 }) + end f:close() end), awful.key({ cmdmodkey, "Shift" }, "backslash", function ()