25 lines
610 B
Lua
25 lines
610 B
Lua
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
|
|
|
|
|
|
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,
|
|
exe_callback = shutdown
|
|
}
|
|
end,
|
|
{
|
|
description = "Shutdown",
|
|
group = "System"
|
|
}
|
|
)
|
|
)
|