nova-shell/shell/modules/PowerModule.qml

42 lines
933 B
QML

import QtQuick
import Quickshell
import Quickshell.Io
import "." as M
import "../services" as S
import "../applets" as C
M.BarModule {
id: root
tooltip: "Power menu"
Process {
id: runner
}
M.BarIcon {
icon: "\uF011"
anchors.verticalCenter: parent.verticalCenter
}
M.HoverPanel {
id: hoverPanel
showPanel: root._showPanel
screen: QsWindow.window?.screen ?? null
anchorItem: root
accentColor: root.accentColor
panelNamespace: "nova-power"
panelTitle: "Power"
contentWidth: 180
onDismissed: root.dismissPanel()
C.PowerApplet {
width: hoverPanel.contentWidth
accentColor: root.accentColor
onRunCommand: cmd => {
runner.command = cmd;
runner.running = true;
}
onDismiss: root.dismissPanel()
}
}
}