Compare commits
2 commits
2f0e6bbb31
...
f342c17444
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f342c17444 | ||
|
|
743374628a |
5 changed files with 141 additions and 0 deletions
|
|
@ -12,6 +12,8 @@ Singleton {
|
||||||
property Mpris mpris: Mpris {}
|
property Mpris mpris: Mpris {}
|
||||||
property Clock clock: Clock {}
|
property Clock clock: Clock {}
|
||||||
property Pipewire pipewire: Pipewire {}
|
property Pipewire pipewire: Pipewire {}
|
||||||
|
property Storage storage: Storage {}
|
||||||
|
property Cpu cpu: Cpu {}
|
||||||
property Caffeine caffeine: Caffeine {}
|
property Caffeine caffeine: Caffeine {}
|
||||||
property Workspace workspace: Workspace {}
|
property Workspace workspace: Workspace {}
|
||||||
property Tray tray: Tray {}
|
property Tray tray: Tray {}
|
||||||
|
|
@ -56,6 +58,26 @@ Singleton {
|
||||||
property int verticalPadding: 6
|
property int verticalPadding: 6
|
||||||
}
|
}
|
||||||
|
|
||||||
|
component Storage: QtObject {
|
||||||
|
id: clock
|
||||||
|
|
||||||
|
property int iconSize: 14
|
||||||
|
property int fontSize: 14
|
||||||
|
property int height: 30
|
||||||
|
property int horizontalPadding: 8
|
||||||
|
property int verticalPadding: 6
|
||||||
|
}
|
||||||
|
|
||||||
|
component Cpu: QtObject {
|
||||||
|
id: clock
|
||||||
|
|
||||||
|
property int iconSize: 14
|
||||||
|
property int fontSize: 14
|
||||||
|
property int height: 30
|
||||||
|
property int horizontalPadding: 8
|
||||||
|
property int verticalPadding: 6
|
||||||
|
}
|
||||||
|
|
||||||
component Caffeine: QtObject {
|
component Caffeine: QtObject {
|
||||||
id: clock
|
id: clock
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ import Quickshell
|
||||||
Singleton {
|
Singleton {
|
||||||
property string brickWall: "\u{E586}"
|
property string brickWall: "\u{E586}"
|
||||||
property string coffee: "\u{E09a}"
|
property string coffee: "\u{E09a}"
|
||||||
|
property string cpu: "\u{E0ad}"
|
||||||
|
property string hardDrive: "\u{E0f1}"
|
||||||
property string triangle: "\u{E192}"
|
property string triangle: "\u{E192}"
|
||||||
property string triangleDashed: "\u{E642}"
|
property string triangleDashed: "\u{E642}"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -104,6 +104,14 @@ Scope {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Storage {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
Cpu {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
Clock {
|
Clock {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
|
||||||
65
modules/bar/components/Cpu.qml
Normal file
65
modules/bar/components/Cpu.qml
Normal file
|
|
@ -0,0 +1,65 @@
|
||||||
|
import QtQuick
|
||||||
|
import Quickshell
|
||||||
|
import "../../../config/"
|
||||||
|
import "../../../constants/"
|
||||||
|
import "../../../services/"
|
||||||
|
import "../../../styled/"
|
||||||
|
import "../../../utils/"
|
||||||
|
|
||||||
|
Clickable {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property bool showTemp: true
|
||||||
|
|
||||||
|
implicitWidth: row.width
|
||||||
|
implicitHeight: Dimensions.storage.height
|
||||||
|
|
||||||
|
Ref {
|
||||||
|
service: SystemInfo
|
||||||
|
}
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
root.showTemp = !root.showTemp;
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: row
|
||||||
|
StyledText {
|
||||||
|
id: icon
|
||||||
|
|
||||||
|
font.family: Theme.lucide.font.family
|
||||||
|
font.pixelSize: Dimensions.storage.iconSize
|
||||||
|
font.bold: true
|
||||||
|
text: Icons.cpu
|
||||||
|
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
topPadding: Dimensions.storage.verticalPadding
|
||||||
|
bottomPadding: Dimensions.storage.verticalPadding
|
||||||
|
leftPadding: Dimensions.storage.horizontalPadding
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
id: text
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
topPadding: Dimensions.storage.verticalPadding
|
||||||
|
bottomPadding: Dimensions.storage.verticalPadding
|
||||||
|
rightPadding: Dimensions.storage.horizontalPadding
|
||||||
|
|
||||||
|
font.pixelSize: Dimensions.storage.fontSize
|
||||||
|
|
||||||
|
text: ` ${(SystemInfo.cpuPerc * 100).toFixed()}%`
|
||||||
|
|
||||||
|
states: [
|
||||||
|
State {
|
||||||
|
name: "temp"
|
||||||
|
when: root.showTemp
|
||||||
|
PropertyChanges {
|
||||||
|
text {
|
||||||
|
text: ` ${(SystemInfo.cpuTemp)}℃`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
44
modules/bar/components/Storage.qml
Normal file
44
modules/bar/components/Storage.qml
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
import QtQuick
|
||||||
|
import Quickshell
|
||||||
|
import "../../../config/"
|
||||||
|
import "../../../constants/"
|
||||||
|
import "../../../services/"
|
||||||
|
import "../../../styled/"
|
||||||
|
import "../../../utils/"
|
||||||
|
|
||||||
|
StyledLabel {
|
||||||
|
implicitWidth: childrenRect.width
|
||||||
|
implicitHeight: Dimensions.storage.height
|
||||||
|
|
||||||
|
Ref {
|
||||||
|
service: SystemInfo
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
StyledText {
|
||||||
|
id: icon
|
||||||
|
|
||||||
|
font.family: Theme.lucide.font.family
|
||||||
|
font.pixelSize: Dimensions.storage.iconSize
|
||||||
|
font.bold: true
|
||||||
|
text: Icons.hardDrive
|
||||||
|
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
topPadding: Dimensions.storage.verticalPadding
|
||||||
|
bottomPadding: Dimensions.storage.verticalPadding
|
||||||
|
leftPadding: Dimensions.storage.horizontalPadding
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
id: text
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
topPadding: Dimensions.storage.verticalPadding
|
||||||
|
bottomPadding: Dimensions.storage.verticalPadding
|
||||||
|
rightPadding: Dimensions.storage.horizontalPadding
|
||||||
|
|
||||||
|
font.pixelSize: Dimensions.storage.fontSize
|
||||||
|
|
||||||
|
text: ` ${(SystemInfo.storagePerc * 100).toFixed()}%`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue