import QtQuick import QtQuick.Layouts import Quickshell.Io // Mirrors eww logout-menu Item { id: root property bool open: false implicitHeight: 26 implicitWidth: lrow.implicitWidth Row { id: lrow spacing: 4 layoutDirection: Qt.RightToLeft // Toggle btn Rectangle { width: 26; height: 26; radius: 13 color: root.open ? "#89b4fa" : "#313244" Text { anchors.centerIn: parent text: root.open ? "󰅖" : "󰍃" color: root.open ? "#1e1e2e" : "#cdd6f4" font.pixelSize: 14 } MouseArea { anchors.fill: parent onClicked: root.open = !root.open cursorShape: Qt.PointingHandCursor } } // Revealed actions Item { id: menuReveal width: root.open ? actionRow.implicitWidth + 8 : 0 height: 26 clip: true Behavior on width { NumberAnimation { duration: 200; easing.type: Easing.InOutQuad } } Row { id: actionRow anchors.verticalCenter: parent.verticalCenter spacing: 4 x: 4 // Lock PowerBtn { icon: "󰌾"; onActivated: run(["hyprlock"]) } // Reboot PowerBtn { icon: "󰜉"; onActivated: run(["systemctl","reboot"]) } // Power off PowerBtn { icon: "󰐥"; onActivated: run(["systemctl","poweroff"]) } // Logout (exit Hyprland) PowerBtn { icon: "󰍃"; onActivated: run(["hyprctl","dispatch","exit"]) } } } } function run(cmd) { root.open = false Qt.createQmlObject( 'import Quickshell.Io; Process { command: ' + JSON.stringify(cmd) + '; running: true }', root) } }