beautiful: add get_image function
this commit adds awful.beautiful.get_image(imgspec) to retrieve an image from a beautiful theme
This commit is contained in:
parent
950e9f96c5
commit
58693c3d7d
|
@ -5,6 +5,7 @@
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
local package = package
|
local package = package
|
||||||
|
local image = image
|
||||||
|
|
||||||
--- Beautiful module for awful
|
--- Beautiful module for awful
|
||||||
module("awful.beautiful")
|
module("awful.beautiful")
|
||||||
|
@ -30,4 +31,14 @@ 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
|
||||||
|
|
Loading…
Reference in New Issue