awesomewm/binds/system.lua

25 lines
610 B
Lua
Raw Normal View History

2022-07-16 17:41:00 -07:00
local function shutdown(confirm_prompt)
if (string.lower(confirm_prompt) == "y") or (string.lower(confirm_prompt) == "yes") then
awful.spawn("shutdown now", false)
elseif (string.lower(confirm_prompt) == "r") or (string.lower(confirm_prompt) == "reset") then
awful.spawn("shutdown -r now", false)
end
end
2021-08-01 07:24:26 -07:00
return gears.table.join(
awful.key( {"Mod4"}, "p",
function ()
awful.prompt.run {
prompt = "<b>Really shutdown? (y/n/r) </b>",
textbox = awful.screen.focused().mypromptbox.widget,
2022-07-16 17:41:00 -07:00
exe_callback = shutdown
2021-08-01 07:24:26 -07:00
}
end,
{
description = "Shutdown",
group = "System"
}
)
)