Files
Aurora/config/aurora/modules/Power.qml
2026-04-09 11:16:48 -05:00

127 lines
3.6 KiB
QML

import Quickshell // for PanelWindow
import QtQuick // for Text
import QtQuick.Shapes
import QtQuick.Controls
import QtQuick.Layouts
import Quickshell.Io
import Quickshell.Widgets
import Quickshell.Wayland
import Quickshell.Hyprland
PanelWindow {
anchors {
top: true
left: true
right: true
bottom: true
}
exclusionMode: ExclusionMode.Ignore
WlrLayershell.layer: WlrLayer.Overlay
id: root
mask: Region {
item: out
}
color: "#99000000"
Lock {
id: lock
bg_path: "/tmp/nathan/tmp.jpg"
//locked: true
}
MouseArea {
id: out
anchors.fill: parent
onClicked: {
root.visible = false
}
ClippingRectangle {
implicitWidth: 200
implicitHeight: 200
id: main
anchors.centerIn: parent
radius: 10
color: "transparent"
GridLayout {
columns: 2
rows: 2
Repeater {
model: 4
WrapperMouseArea {
ClippingWrapperRectangle {
radius: 10
Text {
text: switch(index) {
case 0:
return "󰍃"
case 1:
return " "
case 2:
return " "
case 3:
return " "
default:
return " "
break;
}
font.pointSize: 16
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
color: Settings.special.foreground
}
implicitHeight: 60
implicitWidth: 60
color: parent.contansMouse ? Settings.colors.color12 : Settings.colors.color4
}
hoverEnabled: true
onEntered: {
child.color = Settings.colors.color12
}
onExited: {
child.color = Settings.colors.color4
}
onClicked: {
root.visible = false
switch(index) {
case 0:
Hyprland.dispatch("exec loginctl kill-session self")
break;
case 1:
Hyprland.dispatch("exec systemctl reboot")
break;
case 2:
Hyprland.dispatch("exec loginctl lock-session")
break;
case 3:
Hyprland.dispatch("exec systemctl poweroff")
break;
default:
lock.locked = true
break;
}
}
}
}
}
}
}
}