Merge pull request #26 from Nooo37/playerctl-fixes

Deal with playerctl signal module leaks
This commit is contained in:
gokul swaminathan 2021-03-12 03:28:06 -08:00 committed by GitHub
commit 1561955579
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 1 deletions

View File

@ -34,6 +34,7 @@ local function emit_player_status()
awesome.emit_signal("bling::playerctl::status", playing) awesome.emit_signal("bling::playerctl::status", playing)
end end
}) })
collectgarbage("collect")
end) end)
end end
@ -79,6 +80,7 @@ echo "$tmp_cover_path"
end end
end end
end) end)
collectgarbage("collect")
end) end)
-- Follow title -- Follow title
@ -103,8 +105,10 @@ echo "$tmp_cover_path"
awesome.emit_signal("bling::playerctl::player_stopped") awesome.emit_signal("bling::playerctl::player_stopped")
end end
end) end)
collectgarbage("collect")
end end
}) })
collectgarbage("collect")
end) end)
end end
@ -117,4 +121,12 @@ local enable = function()
emit_player_info() emit_player_info()
end end
return {enable = enable} local disable = function()
awful.spawn.with_shell("pkill --full --uid " .. os.getenv("USER") ..
" '^playerctl status -F'")
awful.spawn.with_shell("pkill --full --uid " .. os.getenv("USER") ..
" '^playerctl metadata --format'")
end
return {enable = enable, disable = disable}