memory usage
This commit is contained in:
parent
f342c17444
commit
bcd6b3c595
4 changed files with 57 additions and 19 deletions
|
|
@ -13,6 +13,7 @@ Singleton {
|
||||||
property Clock clock: Clock {}
|
property Clock clock: Clock {}
|
||||||
property Pipewire pipewire: Pipewire {}
|
property Pipewire pipewire: Pipewire {}
|
||||||
property Storage storage: Storage {}
|
property Storage storage: Storage {}
|
||||||
|
property Memory memory: Memory {}
|
||||||
property Cpu cpu: Cpu {}
|
property Cpu cpu: Cpu {}
|
||||||
property Caffeine caffeine: Caffeine {}
|
property Caffeine caffeine: Caffeine {}
|
||||||
property Workspace workspace: Workspace {}
|
property Workspace workspace: Workspace {}
|
||||||
|
|
@ -20,8 +21,6 @@ Singleton {
|
||||||
property TrayMenu trayMenu: TrayMenu {}
|
property TrayMenu trayMenu: TrayMenu {}
|
||||||
|
|
||||||
component Bar: QtObject {
|
component Bar: QtObject {
|
||||||
id: bar
|
|
||||||
|
|
||||||
property int spacing: 8
|
property int spacing: 8
|
||||||
property int border: 2
|
property int border: 2
|
||||||
property int height: 50
|
property int height: 50
|
||||||
|
|
@ -32,8 +31,6 @@ Singleton {
|
||||||
}
|
}
|
||||||
|
|
||||||
component Mpris: QtObject {
|
component Mpris: QtObject {
|
||||||
id: clock
|
|
||||||
|
|
||||||
property int fontSize: 14
|
property int fontSize: 14
|
||||||
property int height: 30
|
property int height: 30
|
||||||
property int horizontalPadding: 8
|
property int horizontalPadding: 8
|
||||||
|
|
@ -41,8 +38,6 @@ Singleton {
|
||||||
}
|
}
|
||||||
|
|
||||||
component Clock: QtObject {
|
component Clock: QtObject {
|
||||||
id: clock
|
|
||||||
|
|
||||||
property int fontSize: 14
|
property int fontSize: 14
|
||||||
property int height: 30
|
property int height: 30
|
||||||
property int horizontalPadding: 8
|
property int horizontalPadding: 8
|
||||||
|
|
@ -50,8 +45,6 @@ Singleton {
|
||||||
}
|
}
|
||||||
|
|
||||||
component Pipewire: QtObject {
|
component Pipewire: QtObject {
|
||||||
id: clock
|
|
||||||
|
|
||||||
property int fontSize: 14
|
property int fontSize: 14
|
||||||
property int height: 30
|
property int height: 30
|
||||||
property int horizontalPadding: 8
|
property int horizontalPadding: 8
|
||||||
|
|
@ -59,8 +52,14 @@ Singleton {
|
||||||
}
|
}
|
||||||
|
|
||||||
component Storage: QtObject {
|
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 Memory: QtObject {
|
||||||
property int iconSize: 14
|
property int iconSize: 14
|
||||||
property int fontSize: 14
|
property int fontSize: 14
|
||||||
property int height: 30
|
property int height: 30
|
||||||
|
|
@ -69,8 +68,6 @@ Singleton {
|
||||||
}
|
}
|
||||||
|
|
||||||
component Cpu: QtObject {
|
component Cpu: QtObject {
|
||||||
id: clock
|
|
||||||
|
|
||||||
property int iconSize: 14
|
property int iconSize: 14
|
||||||
property int fontSize: 14
|
property int fontSize: 14
|
||||||
property int height: 30
|
property int height: 30
|
||||||
|
|
@ -79,8 +76,6 @@ Singleton {
|
||||||
}
|
}
|
||||||
|
|
||||||
component Caffeine: QtObject {
|
component Caffeine: QtObject {
|
||||||
id: clock
|
|
||||||
|
|
||||||
property int fontSize: 16
|
property int fontSize: 16
|
||||||
property int height: 30
|
property int height: 30
|
||||||
property int horizontalPadding: 8
|
property int horizontalPadding: 8
|
||||||
|
|
@ -88,8 +83,6 @@ Singleton {
|
||||||
}
|
}
|
||||||
|
|
||||||
component Workspace: QtObject {
|
component Workspace: QtObject {
|
||||||
id: workspace
|
|
||||||
|
|
||||||
property int spacing: 5
|
property int spacing: 5
|
||||||
property int iconSize: 16
|
property int iconSize: 16
|
||||||
property int width: 30
|
property int width: 30
|
||||||
|
|
@ -99,8 +92,6 @@ Singleton {
|
||||||
}
|
}
|
||||||
|
|
||||||
component Tray: QtObject {
|
component Tray: QtObject {
|
||||||
id: tray
|
|
||||||
|
|
||||||
property int spacing: 5
|
property int spacing: 5
|
||||||
property int iconSize: 18
|
property int iconSize: 18
|
||||||
property int width: 30
|
property int width: 30
|
||||||
|
|
@ -110,8 +101,6 @@ Singleton {
|
||||||
}
|
}
|
||||||
|
|
||||||
component TrayMenu: QtObject {
|
component TrayMenu: QtObject {
|
||||||
id: trayItem
|
|
||||||
|
|
||||||
property int fontSize: 10
|
property int fontSize: 10
|
||||||
property int width: 30
|
property int width: 30
|
||||||
property int height: 30
|
property int height: 30
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ Singleton {
|
||||||
property string coffee: "\u{E09a}"
|
property string coffee: "\u{E09a}"
|
||||||
property string cpu: "\u{E0ad}"
|
property string cpu: "\u{E0ad}"
|
||||||
property string hardDrive: "\u{E0f1}"
|
property string hardDrive: "\u{E0f1}"
|
||||||
|
property string memoryStick: "\u{E44a}"
|
||||||
property string triangle: "\u{E192}"
|
property string triangle: "\u{E192}"
|
||||||
property string triangleDashed: "\u{E642}"
|
property string triangleDashed: "\u{E642}"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,10 @@ Scope {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Memory {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
Cpu {
|
Cpu {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
|
||||||
44
modules/bar/components/Memory.qml
Normal file
44
modules/bar/components/Memory.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.memory.height
|
||||||
|
|
||||||
|
Ref {
|
||||||
|
service: SystemInfo
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
StyledText {
|
||||||
|
id: icon
|
||||||
|
|
||||||
|
font.family: Theme.lucide.font.family
|
||||||
|
font.pixelSize: Dimensions.memory.iconSize
|
||||||
|
font.bold: true
|
||||||
|
text: Icons.memoryStick
|
||||||
|
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
topPadding: Dimensions.memory.verticalPadding
|
||||||
|
bottomPadding: Dimensions.memory.verticalPadding
|
||||||
|
leftPadding: Dimensions.memory.horizontalPadding
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
id: text
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
topPadding: Dimensions.memory.verticalPadding
|
||||||
|
bottomPadding: Dimensions.memory.verticalPadding
|
||||||
|
rightPadding: Dimensions.memory.horizontalPadding
|
||||||
|
|
||||||
|
font.pixelSize: Dimensions.memory.fontSize
|
||||||
|
|
||||||
|
text: ` ${(SystemInfo.memPerc * 100).toFixed()}%`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue