fix(beautiful: xresources): don't return fallback colorscheme if only some of the values are missing (#2151)
related to #2150
This commit is contained in:
parent
ad68d3bf5b
commit
19a1ee6c16
|
@ -51,14 +51,18 @@ function xresources.get_current_theme()
|
|||
for i=0,15 do table.insert(keys, "color"..i) end
|
||||
local colors = {}
|
||||
for _, key in ipairs(keys) do
|
||||
colors[key] = awesome.xrdb_get_value("", key)
|
||||
if not colors[key] then
|
||||
gears_debug.print_warning("beautiful: can't get colorscheme from xrdb (using fallback).")
|
||||
return fallback
|
||||
end
|
||||
if colors[key]:find("rgb:") then
|
||||
colors[key] = "#"..colors[key]:gsub("[a]?rgb:", ""):gsub("/", "")
|
||||
local color = awesome.xrdb_get_value("", key)
|
||||
if color then
|
||||
if color:find("rgb:") then
|
||||
color = "#"..color:gsub("[a]?rgb:", ""):gsub("/", "")
|
||||
end
|
||||
else
|
||||
gears_debug.print_warning(
|
||||
"beautiful: can't get colorscheme from xrdb for value '"..key.."' (using fallback)."
|
||||
)
|
||||
color = fallback[key]
|
||||
end
|
||||
colors[key] = color
|
||||
end
|
||||
return colors
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue