Files
nixos/Droidnix/generated/.config/quickshell/powermenu/shell.qml
T
2026-04-11 20:24:42 +02:00

110 lines
3.6 KiB
QML

// --- This file has been auto-generated. For permanent changes alter the appropriate block in the README.org. ---
// PowerMenu.qml
import "../"
import Quickshell
import Quickshell.Io
import QtQuick
import QtQuick.Layouts
ShellRoot {
FloatingWindow {
id: root
visible: true
width: 220
height: contentLayout.implicitHeight + 32
color: "transparent"
// Close on Escape
Shortcut {
sequence: "Escape"
onActivated: Qt.quit()
}
Rectangle {
anchors.fill: parent
radius: 16
color: Colors.base
border.width: 2
border.color: Colors.blue
ColumnLayout {
id: contentLayout
anchors {
top: parent.top
left: parent.left
right: parent.right
margins: 16
}
spacing: 4
// Title
Text {
text: " Power Menu"
color: Colors.teal
font.pixelSize: 13
font.bold: true
Layout.bottomMargin: 8
}
// Menu items
Repeater {
model: [
{ label: " Lock", cmd: ["loginctl", "lock-session"] },
{ label: " Shutdown", cmd: ["systemctl", "poweroff"] },
{ label: " Reboot", cmd: ["systemctl", "reboot"] },
{ label: "󰍃 Logout", cmd: ["bash", "-c", "loginctl terminate-session $XDG_SESSION_ID"] },
{ label: " Hibernate", cmd: ["systemctl", "hibernate"] },
{ label: " Suspend", cmd: ["systemctl", "suspend"] },
]
delegate: Rectangle {
id: item
Layout.fillWidth: true
height: 38
radius: 8
color: hovered ? Colors.surface1 : "transparent"
property bool hovered: false
// Gradient border on hover
Rectangle {
anchors.fill: parent
radius: parent.radius
color: "transparent"
border.width: item.hovered ? 2 : 0
border.color: Colors.blue
}
Text {
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: 12
text: modelData.label
color: item.hovered ? Colors.text : Colors.subtext1
font.pixelSize: 13
}
MouseArea {
anchors.fill: parent
hoverEnabled: true
onEntered: item.hovered = true
onExited: item.hovered = false
onClicked: proc.running = true
}
Process {
id: proc
command: modelData.cmd
onExited: Qt.quit()
}
}
}
// Bottom padding
Item { height: 4 }
}
}
}
}