From 631c285a75121c97cc7b066bec743c216f5b13df Mon Sep 17 00:00:00 2001 From: Gokul Swami Date: Wed, 10 Mar 2021 12:52:31 -0800 Subject: [PATCH 1/2] Added a disable function to playerctl The disable function kills all playerct follows started by the module --- signal/playerctl.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/signal/playerctl.lua b/signal/playerctl.lua index 21c6212..4734691 100644 --- a/signal/playerctl.lua +++ b/signal/playerctl.lua @@ -117,4 +117,12 @@ local enable = function() emit_player_info() 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} From 05ca7dec6e61bc885112452229c3c9490c3b60c1 Mon Sep 17 00:00:00 2001 From: Gokul Swami Date: Thu, 11 Mar 2021 04:35:50 -0800 Subject: [PATCH 2/2] Added collects --- signal/playerctl.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/signal/playerctl.lua b/signal/playerctl.lua index 4734691..6aa0463 100644 --- a/signal/playerctl.lua +++ b/signal/playerctl.lua @@ -34,6 +34,7 @@ local function emit_player_status() awesome.emit_signal("bling::playerctl::status", playing) end }) + collectgarbage("collect") end) end @@ -79,6 +80,7 @@ echo "$tmp_cover_path" end end end) + collectgarbage("collect") end) -- Follow title @@ -103,8 +105,10 @@ echo "$tmp_cover_path" awesome.emit_signal("bling::playerctl::player_stopped") end end) + collectgarbage("collect") end }) + collectgarbage("collect") end) end