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:
Gregor Best 2008-11-08 15:24:40 +01:00 committed by Julien Danjou
parent 950e9f96c5
commit 58693c3d7d
1 changed files with 11 additions and 0 deletions

View File

@ -5,6 +5,7 @@
---------------------------------------------------------------------------
local package = package
local image = image
--- Beautiful module for awful
module("awful.beautiful")
@ -30,4 +31,14 @@ 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