power menu

This commit is contained in:
Damocles 2026-04-12 14:55:25 +02:00
parent 6f80224d6c
commit 5b82205e63
4 changed files with 147 additions and 8 deletions

View file

@ -1,20 +1,27 @@
import QtQuick
import Quickshell.Io
import "." as M
M.BarIcon {
id: root
icon: "\uF011"
color: M.Theme.base08
tooltip: "Open logout menu"
tooltip: "Power menu"
Process {
id: proc
command: ["wlogout"]
}
required property var bar
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: proc.running = true
onClicked: menuLoader.active = !menuLoader.active
}
Loader {
id: menuLoader
active: false
sourceComponent: M.PowerMenu {
screen: root.bar.screen
anchorX: root.mapToGlobal(root.width / 2, 0).x
onMenuClosed: menuLoader.active = false
}
}
}