This is a mostly faithful clone of wlogout.
You can run the example with quickshell -p shell.qml.
quickshell -p shell.qml