icons: move icon lookup in a seperate module

This commit is contained in:
Vincent Bernat 2012-07-15 22:22:38 +02:00
parent 52090d90ea
commit 335b80262d
8 changed files with 104 additions and 26 deletions

View file

@ -1,5 +1,7 @@
-- Menu with xrandr choices
local icons = loadrc("icons", "vbe/icons")
-- Get active outputs
local function outputs()
local outputs = {}
@ -76,7 +78,7 @@ local function menu()
menu[#menu + 1] = { label,
cmd,
"/usr/share/icons/gnome/32x32/devices/display.png" }
icons.lookup({ name = "display", type = "devices" }) }
end
return menu
@ -103,7 +105,7 @@ local function xrandr()
local next = state.iterator()
local label, action, icon
if not next then
label, icon = "Keep the current configuration", "/usr/share/icons/gnome/32x32/devices/display.png"
label, icon = "Keep the current configuration", icons.lookup({ name = "display", type = "devices" })
state.iterator = nil
else
label, action, icon = unpack(next)