add systemd and machinectl bar modules with applets
This commit is contained in:
parent
7ab784e101
commit
8ab3fc5f6b
12 changed files with 1117 additions and 1 deletions
44
shell/modules/MachinectlModule.qml
Normal file
44
shell/modules/MachinectlModule.qml
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import QtQuick
|
||||
import Quickshell
|
||||
import "." as M
|
||||
import "../services" as S
|
||||
import "../applets" as C
|
||||
|
||||
M.BarModule {
|
||||
id: root
|
||||
active: S.Modules.machinectl.enable
|
||||
tooltip: {
|
||||
const n = S.MachinectlService.machines.length;
|
||||
return n === 0 ? "no containers" : n + " container" + (n === 1 ? "" : "s");
|
||||
}
|
||||
panelNamespace: "nova-machinectl"
|
||||
panelContentWidth: 320
|
||||
panelComponent: Component {
|
||||
C.MachinectlApplet {
|
||||
width: parent.width
|
||||
accentColor: root.accentColor
|
||||
active: root._showPanel
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: S.MachinectlService
|
||||
function onMachineReady() {
|
||||
root.keepPanelOpen(300);
|
||||
}
|
||||
}
|
||||
|
||||
readonly property color _stateColor: S.MachinectlService.anyUnhealthy ? S.Theme.base0A : root.accentColor
|
||||
|
||||
M.BarIcon {
|
||||
icon: ""
|
||||
color: root._stateColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
M.BarLabel {
|
||||
label: S.MachinectlService.machines.length.toString()
|
||||
minText: "9"
|
||||
color: root._stateColor
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue