This is a Python utility to generate simple dialog boxes to logout, suspend, reboot, shutdown, or do a custom action. General usage looks something like this:
sys-dialog.py exit_wayland # To logout
sys-dialog.py suspend # To suspend
sys-dialog.py reboot # To reboot
sys-dialog.py shutdown # To shutdown
# For a custom command
sys-dialog.py custom -w "Custom dialog window title" \
-q "Custom question to show in dialog box" \
-c "my_command_to_run"
Suspending, rebooting and shutting down depend upon the systemctl
utility.
Logging out will using the Wayland compositor's own means for logging
out, provided that compositor is one of Sway,
Hyprland, Labwc, or
Niri. Otherwise, it will fall back
to using the command wayland-logout.
This script depends upon PyQt6, which is under GPL-3.0, so the script is also under GPL-3.0. The Nix code, though, is simply under the MIT license.