From 09b273e8ba4af0bb5f47b0c08f7e50e2b59a1837 Mon Sep 17 00:00:00 2001 From: voidarc Date: Mon, 17 Aug 2026 21:09:33 +0100 Subject: [PATCH] logout menu fully functional --- Bar/Time.qml | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/Bar/Time.qml b/Bar/Time.qml index cb604dc..b0ecb11 100644 --- a/Bar/Time.qml +++ b/Bar/Time.qml @@ -4,6 +4,7 @@ import QtQuick.Controls import QtQuick.Layouts import Quickshell import Quickshell.Hyprland +import Quickshell.Io import Quickshell.Services.Notifications import Quickshell.Widgets @@ -172,28 +173,33 @@ Container { property var logoutModel: [ { color: Colors.red, - text: "s", - key: Qt.Key_S + text: "", + key: Qt.Key_S, + command: ["systemctl", "poweroff"] }, { color: Colors.peach, - text: "e", - key: Qt.Key_E + text: "󰗽", + key: Qt.Key_E, + command: ["hyprctl", "dispatch", "'hl.dsp.exit()'"] }, { color: Colors.yellow, - text: "r", - key: Qt.Key_R + text: "󰑓", + key: Qt.Key_R, + command: ["systemctl", "reboot"] }, { color: Colors.green, - text: "l", - key: Qt.Key_L + text: "󰌾", + key: Qt.Key_L, + command: ["hyprlock"] }, { color: Colors.sky, - text: "u", - key: Qt.Key_U + text: "󰤄", + key: Qt.Key_U, + command: ["systemctl", "suspend"] }, ] @@ -206,7 +212,9 @@ Container { } else { for (let button of logoutMenuRoot.logoutModel) { if (button.key == event.key) { + IpcManager.closeLogoutMenu(); event.accepted = true; + Quickshell.execDetached(button.command); } } } @@ -244,7 +252,9 @@ Container { StyledText { anchors.fill: parent + fontSize: 25 horizontalAlignment: Qt.AlignHCenter + propo: true text: logoutButtonRoot.modelData.text verticalAlignment: Qt.AlignVCenter }