From 7c775e967ce14c9df4922a2d3b4199b68daf2a1c Mon Sep 17 00:00:00 2001 From: Lego Stax Date: Wed, 15 Mar 2017 09:29:53 -0700 Subject: [PATCH] Fix 'no such file' errors for icons (#1655) Fixes https://github.com/awesomeWM/awesome/issues/1650. Signed-off-by: Lego Stax legostax@gmail.com --- lib/awful/titlebar.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/awful/titlebar.lua b/lib/awful/titlebar.lua index a7407aaf..5f3fd756 100644 --- a/lib/awful/titlebar.lua +++ b/lib/awful/titlebar.lua @@ -615,13 +615,14 @@ function titlebar.widget.button(c, name, selector, action) if img ~= "" then prefix = prefix .. "_" end - if ret.state ~= "" then - img = img .. "_" + local state = ret.state + if state ~= "" then + state = "_" .. state end -- First try with a prefix based on the client's focus state, -- then try again without that prefix if nothing was found, -- and finally, try a fallback for compatibility with Awesome 3.5 themes - local theme = beautiful["titlebar_" .. name .. "_button_" .. prefix .. img .. ret.state] + local theme = beautiful["titlebar_" .. name .. "_button_" .. prefix .. img .. state] or beautiful["titlebar_" .. name .. "_button_" .. prefix .. img] or beautiful["titlebar_" .. name .. "_button_" .. img] or beautiful["titlebar_" .. name .. "_button_" .. prefix .. "_inactive"]