diff --git a/signal/playerctl.lua b/signal/playerctl.lua index 4adb08b..1d2255a 100644 --- a/signal/playerctl.lua +++ b/signal/playerctl.lua @@ -81,20 +81,19 @@ echo "$tmp_cover_path" -- Follow title awful.spawn.easy_async_with_shell( - "ps x | grep \"playerctl metadata\" | grep -v grep | awk '{print $1}' | xargs kill", - function() + "ps x | grep \"playerctl metadata\" | grep -v grep | awk '{print $1}' | xargs kill", function() awful.spawn.with_line_callback(song_follow_cmd, { stdout = function(line) + local album_path = "" awful.spawn.easy_async_with_shell(art_script, function(out) -- Get album path - local album_path = out:gsub('%\n', '') - -- Get Title and Artist - local artist = line:match('artist_(.*)title_') - local title = line:match('title_(.*)') - awesome.emit_signal( - "bling::playerctl::title_artist_album", title, - artist, album_path) + album_path = out:gsub('%\n', '') end) + -- Get title and artist + local artist = line:match('artist_(.*)title_') + local title = line:match('title_(.*)') + awesome.emit_signal("bling::playerctl::title_artist_album", + title, artist, album_path) end }) end)