code cleanup/ simplified
This commit is contained in:
parent
9a9a89ea73
commit
e47db962d0
|
@ -26,7 +26,7 @@ local logout_menu_widget = wibox.widget {
|
||||||
layout = wibox.container.margin
|
layout = wibox.container.margin
|
||||||
},
|
},
|
||||||
shape = function(cr, width, height)
|
shape = function(cr, width, height)
|
||||||
gears.shape.rounded_rect(cr, width, height, 4)
|
gears.shape.rounded_rect(cr, width, height, 4)
|
||||||
end,
|
end,
|
||||||
widget = wibox.container.background,
|
widget = wibox.container.background,
|
||||||
}
|
}
|
||||||
|
@ -58,11 +58,11 @@ local function worker(user_args)
|
||||||
local onpoweroff = args.onpoweroff or function() awful.spawn.with_shell("shutdown now") end
|
local onpoweroff = args.onpoweroff or function() awful.spawn.with_shell("shutdown now") end
|
||||||
|
|
||||||
local menu_items = {
|
local menu_items = {
|
||||||
{ name = 'Log out', icon_name = 'log-out.svg', command = function () logout_menu_widget:set_bg('#00000000') onlogout() end },
|
{ name = 'Log out', icon_name = 'log-out.svg', command = onlogout },
|
||||||
{ name = 'Lock', icon_name = 'lock.svg', command = function () logout_menu_widget:set_bg('#00000000') onlock() end },
|
{ name = 'Lock', icon_name = 'lock.svg', command = onlock },
|
||||||
{ name = 'Reboot', icon_name = 'refresh-cw.svg', command = function () logout_menu_widget:set_bg('#00000000') onreboot() end },
|
{ name = 'Reboot', icon_name = 'refresh-cw.svg', command = onreboot },
|
||||||
{ name = 'Suspend', icon_name = 'moon.svg', command = function () logout_menu_widget:set_bg('#00000000') onsuspend() end },
|
{ name = 'Suspend', icon_name = 'moon.svg', command = onsuspend },
|
||||||
{ name = 'Power off', icon_name = 'power.svg', command = function () logout_menu_widget:set_bg('#00000000') onpoweroff() end },
|
{ name = 'Power off', icon_name = 'power.svg', command = onpoweroff },
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, item in ipairs(menu_items) do
|
for _, item in ipairs(menu_items) do
|
||||||
|
@ -109,6 +109,7 @@ local function worker(user_args)
|
||||||
|
|
||||||
row:buttons(awful.util.table.join(awful.button({}, 1, function()
|
row:buttons(awful.util.table.join(awful.button({}, 1, function()
|
||||||
popup.visible = not popup.visible
|
popup.visible = not popup.visible
|
||||||
|
logout_menu_widget:set_bg('#00000000')
|
||||||
item.command()
|
item.command()
|
||||||
end)))
|
end)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue