From 51fbad9e270d20d5dbdde3fe9128a39d1e7b8e69 Mon Sep 17 00:00:00 2001 From: BZ Date: Fri, 19 Jun 2020 12:04:43 +0200 Subject: [PATCH] fix invalid object errors (steam) --- init.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index e7dac6c..3d7c060 100644 --- a/init.lua +++ b/init.lua @@ -66,7 +66,9 @@ local function setup(config) client.connect_signal("manage", function(c) -- set icon based on c.class awful.spawn.easy_async_with_shell("sleep " .. delay, function() - set_icon(c, icons[c.class]) + if c and c.valid and icons[c.class] then + set_icon(c, icons[c.class]) + end end) if len(dynamic_icons) == 0 then @@ -94,8 +96,10 @@ return setmetatable(module, { __call = function(_, ...) -- we also have to manually emit a fake "property::name" signal to update dynamic icons. awful.spawn.easy_async_with_shell("sleep " .. delay, function() for _, c in ipairs(client.get()) do - set_icon(c, icons[c.class]) - c:emit_signal("property::name") + if c and c.valid and icons[c.class] then + set_icon(c, icons[c.class]) + c:emit_signal("property::name") + end end end) end })