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 = "Really shutdown? (y/n/r) ", textbox = awful.screen.focused().mypromptbox.widget, exe_callback = shutdown } end, { description = "Shutdown", group = "System" } ) )