nix/nixos/desktop/quickshell/Session.qml
Markus Zoppelt 6eef44005c feat: quickshell chrome and session helpers
Add Switch, Btn, and Menu. Share Session and Run.term. Widget skill for agents; no plugin host.
2026-08-29 13:46:57 +02:00

38 lines
790 B
QML

pragma Singleton
import Quickshell
import Quickshell.Hyprland
Singleton {
function lock() {
Run.detached(["hyprlock"]);
}
function sleep() {
Quickshell.execDetached(["systemctl", "suspend"]);
}
function relaunch() {
Hyprland.dispatch("exit");
}
function restart() {
Quickshell.execDetached(["systemctl", "reboot"]);
}
function shutdown() {
Quickshell.execDetached(["systemctl", "poweroff"]);
}
function run(id) {
if (id === "lock")
lock();
else if (id === "sleep")
sleep();
else if (id === "relaunch")
relaunch();
else if (id === "restart")
restart();
else if (id === "shutdown")
shutdown();
}
}