Skip to content

Commit

Permalink
code cleanup/ simplified
Browse files Browse the repository at this point in the history
  • Loading branch information
Luka5W committed Dec 14, 2023
1 parent 9a9a89e commit e47db96
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions logout-menu-widget/logout-menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ local logout_menu_widget = wibox.widget {
layout = wibox.container.margin
},
shape = function(cr, width, height)
gears.shape.rounded_rect(cr, width, height, 4)
gears.shape.rounded_rect(cr, width, height, 4)
end,
widget = wibox.container.background,
}
Expand Down Expand Up @@ -58,11 +58,11 @@ local function worker(user_args)
local onpoweroff = args.onpoweroff or function() awful.spawn.with_shell("shutdown now") end

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

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

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

Expand Down

0 comments on commit e47db96

Please sign in to comment.