Close a program properly, save a file or stop a service first, then let the computer sleep, hibernate, shut down, restart, log off or lock. With a countdown and a Cancel button. New
Power Events tab in the Settings, which also holds the files for On resume and On suspend.
Read the step by step page.