I want to code an application that is able to poweroff, reboot, logout, lock, suspend etc. without a prompt. Using system commands like systemctl, reboot or poweroff need either su rights or kill the session ungraciously leaving applications no time to save their state.