diff --git a/awesomerc.lua.in b/awesomerc.lua.in index aa4ede22..12fe6655 100644 --- a/awesomerc.lua.in +++ b/awesomerc.lua.in @@ -382,7 +382,7 @@ end) awful.hooks.arrange.register(function (screen) local layout = awful.layout.get(screen) if layout then - mylayoutbox[screen].image = awful.beautiful.get_image("layout_"..layout) + mylayoutbox[screen].image = beautiful.getimage("layout_" .. layout) else mylayoutbox[screen].image = nil end diff --git a/lib/awful/beautiful.lua.in b/lib/awful/beautiful.lua.in index e45d604d..e1f2f855 100644 --- a/lib/awful/beautiful.lua.in +++ b/lib/awful/beautiful.lua.in @@ -5,7 +5,6 @@ --------------------------------------------------------------------------- local package = package -local image = image --- Beautiful module for awful module("awful.beautiful") @@ -31,14 +30,4 @@ function get() return package.loaded.awful.beautiful.theme 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 diff --git a/lib/beautiful.lua.in b/lib/beautiful.lua.in index 7afb59c9..473f0653 100644 --- a/lib/beautiful.lua.in +++ b/lib/beautiful.lua.in @@ -14,7 +14,8 @@ local package = package local capi = { screen = screen, - awesome = awesome + awesome = awesome, + image = image } local module_name = "beautiful" @@ -86,6 +87,17 @@ function init(path) 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]) -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80