rename power

This commit is contained in:
Damocles 2026-04-12 15:57:22 +02:00
commit 4df704844e
4 changed files with 7 additions and 7 deletions

View file

@ -107,7 +107,7 @@ PanelWindow {
}
// Power
M.Wlogout { bar: bar; visible: M.Modules.wlogout }
M.Power { bar: bar; visible: M.Modules.power }
}
}
}

View file

@ -25,7 +25,7 @@ QtObject {
property bool memory: true
property bool disk: true
property bool battery: true
property bool wlogout: true
property bool power: true
property var weatherArgs: ["--nerd"]

37
modules/Power.qml Normal file
View file

@ -0,0 +1,37 @@
import QtQuick
import Quickshell
import Quickshell.Io
import "." as M
M.BarIcon {
id: root
icon: "\uF011"
color: M.Theme.base08
tooltip: "Power menu"
required property var bar
Process {
id: runner
}
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
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 - (QsWindow.window?.screen?.x ?? 0)
onMenuClosed: menuLoader.active = false
onRunCommand: cmd => {
runner.command = cmd;
runner.running = true;
}
}
}
}

View file

@ -30,4 +30,4 @@ Weather 1.0 Weather.qml
PowerProfile 1.0 PowerProfile.qml
IdleInhibitor 1.0 IdleInhibitor.qml
Notifications 1.0 Notifications.qml
Wlogout 1.0 Wlogout.qml
Power 1.0 Power.qml