awful, beautiful: getimage rather belongs in beautiful
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
015c6c5152
commit
7108e5cb20
|
@ -382,7 +382,7 @@ end)
|
||||||
awful.hooks.arrange.register(function (screen)
|
awful.hooks.arrange.register(function (screen)
|
||||||
local layout = awful.layout.get(screen)
|
local layout = awful.layout.get(screen)
|
||||||
if layout then
|
if layout then
|
||||||
mylayoutbox[screen].image = awful.beautiful.get_image("layout_"..layout)
|
mylayoutbox[screen].image = beautiful.getimage("layout_" .. layout)
|
||||||
else
|
else
|
||||||
mylayoutbox[screen].image = nil
|
mylayoutbox[screen].image = nil
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
local package = package
|
local package = package
|
||||||
local image = image
|
|
||||||
|
|
||||||
--- Beautiful module for awful
|
--- Beautiful module for awful
|
||||||
module("awful.beautiful")
|
module("awful.beautiful")
|
||||||
|
@ -31,14 +30,4 @@ function get()
|
||||||
return package.loaded.awful.beautiful.theme
|
return package.loaded.awful.beautiful.theme
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Return an image from the theme
|
|
||||||
-- @param imgspec name of the image key
|
|
||||||
-- @return the image
|
|
||||||
function get_image(imgspec)
|
|
||||||
if theme[imgspec] then
|
|
||||||
return image(theme[imgspec])
|
|
||||||
else
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
||||||
|
|
|
@ -14,7 +14,8 @@ local package = package
|
||||||
local capi =
|
local capi =
|
||||||
{
|
{
|
||||||
screen = screen,
|
screen = screen,
|
||||||
awesome = awesome
|
awesome = awesome,
|
||||||
|
image = image
|
||||||
}
|
}
|
||||||
|
|
||||||
local module_name = "beautiful"
|
local module_name = "beautiful"
|
||||||
|
@ -86,6 +87,17 @@ function init(path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Return an image from the theme.
|
||||||
|
-- @param imgspec Name of the image key.
|
||||||
|
-- @return The image.
|
||||||
|
function getimage(imgspec)
|
||||||
|
if theme[imgspec] then
|
||||||
|
return capi.image(theme[imgspec])
|
||||||
|
else
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
setmetatable(package.loaded[module_name], package.loaded[module_name])
|
setmetatable(package.loaded[module_name], package.loaded[module_name])
|
||||||
|
|
||||||
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
||||||
|
|
Loading…
Reference in New Issue