summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRomanos Skiadas <rom.skiad@gmail.com>2021-10-15 17:41:37 +0300
committerRomanos Skiadas <rom.skiad@gmail.com>2021-10-15 17:51:59 +0300
commitc5852546ae2d7dfddc72526ca164073db86ae2db (patch)
tree32337b553d484153762a5c4c9e883ce8389557b3
parentdb0b3e9e8cbe54d1fe7a6c6b38e83366ae1c744d (diff)
mpris-widget: correctly clean list of players
Do it outside the loop, otherwise the last player wins.
-rw-r--r--mpris-widget/init.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/mpris-widget/init.lua b/mpris-widget/init.lua
index 0dac632..22fd0f7 100644
--- a/mpris-widget/init.lua
+++ b/mpris-widget/init.lua
@@ -72,9 +72,9 @@ local popup = awful.popup{
local function rebuild_popup()
awful.spawn.easy_async(LIST_PLAYERS_CMD, function(stdout, _, _, _)
+ for i = 0, #rows do rows[i]=nil end
for player_name in stdout:gmatch("[^\r\n]+") do
if player_name ~='' and player_name ~=nil then
- for i = 0, #rows do rows[i]=nil end
local checkbox = wibox.widget{
{