X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/a1ba90261b31ccce1ac2ecb7ca7aedbc20eca441..9ec9f475c886a8fba0532cb3d1b47190c01352fa:/widgets/mpd.lua diff --git a/widgets/mpd.lua b/widgets/mpd.lua index c4c4691..58e8303 100644 --- a/widgets/mpd.lua +++ b/widgets/mpd.lua @@ -112,7 +112,7 @@ local function worker(args) if not string.match(mpd_now.file, "http.*://") then -- local file instead of http stream local path = string.format("%s/%s", music_dir, string.match(mpd_now.file, ".*/")) - local cover = string.format("find '%s' -maxdepth 1 -type f | egrep -i -m1 '%s'", path, cover_pattern) + local cover = string.format("find '%s' -maxdepth 1 -type f | egrep -i -m1 '%s'", path:gsub("'", "\'"):gsub('"', '\"'), cover_pattern) helpers.async({ shell, "-c", cover }, function(current_icon) common.icon = current_icon:gsub("\n", "") if #common.icon == 0 then common.icon = nil end