From a03aaec1dccdd84b27fa0a99ce08616dca754ba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bend=C3=ADk?= Date: Sun, 26 Mar 2023 08:09:39 +0200 Subject: [PATCH] Variation without load_silently --- lib/awful/widget/layoutbox.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/awful/widget/layoutbox.lua b/lib/awful/widget/layoutbox.lua index 72eef61e0..b1e21e6b7 100644 --- a/lib/awful/widget/layoutbox.lua +++ b/lib/awful/widget/layoutbox.lua @@ -32,11 +32,13 @@ local function update(w, screen) local name = layout.getname(layout.get(screen)) w._layoutbox_tooltip:set_text(name or "[no name]") - local img = surface.load_silently(beautiful["layout_" .. name], false) - if img then - w.imagebox:set_image(beautiful["layout_" .. name]) + local image_name = "layout_" .. name + local theme_image = beautiful[image_name] + local success = false + if theme_image ~= nil then + success = w.imagebox:set_image(beautiful[image_name]) end - w.textbox.text = img and "" or name + w.textbox.text = success and "" or name end local function update_from_tag(t)