Skip to content

Commit e47db96

Browse files
committed
code cleanup/ simplified
1 parent 9a9a89e commit e47db96

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

logout-menu-widget/logout-menu.lua

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ local logout_menu_widget = wibox.widget {
2626
layout = wibox.container.margin
2727
},
2828
shape = function(cr, width, height)
29-
gears.shape.rounded_rect(cr, width, height, 4)
29+
gears.shape.rounded_rect(cr, width, height, 4)
3030
end,
3131
widget = wibox.container.background,
3232
}
@@ -58,11 +58,11 @@ local function worker(user_args)
5858
local onpoweroff = args.onpoweroff or function() awful.spawn.with_shell("shutdown now") end
5959

6060
local menu_items = {
61-
{ name = 'Log out', icon_name = 'log-out.svg', command = function () logout_menu_widget:set_bg('#00000000') onlogout() end },
62-
{ name = 'Lock', icon_name = 'lock.svg', command = function () logout_menu_widget:set_bg('#00000000') onlock() end },
63-
{ name = 'Reboot', icon_name = 'refresh-cw.svg', command = function () logout_menu_widget:set_bg('#00000000') onreboot() end },
64-
{ name = 'Suspend', icon_name = 'moon.svg', command = function () logout_menu_widget:set_bg('#00000000') onsuspend() end },
65-
{ name = 'Power off', icon_name = 'power.svg', command = function () logout_menu_widget:set_bg('#00000000') onpoweroff() end },
61+
{ name = 'Log out', icon_name = 'log-out.svg', command = onlogout },
62+
{ name = 'Lock', icon_name = 'lock.svg', command = onlock },
63+
{ name = 'Reboot', icon_name = 'refresh-cw.svg', command = onreboot },
64+
{ name = 'Suspend', icon_name = 'moon.svg', command = onsuspend },
65+
{ name = 'Power off', icon_name = 'power.svg', command = onpoweroff },
6666
}
6767

6868
for _, item in ipairs(menu_items) do
@@ -109,6 +109,7 @@ local function worker(user_args)
109109

110110
row:buttons(awful.util.table.join(awful.button({}, 1, function()
111111
popup.visible = not popup.visible
112+
logout_menu_widget:set_bg('#00000000')
112113
item.command()
113114
end)))
114115

0 commit comments

Comments
 (0)