mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-07 22:15:38 -05:00
dgop was rebranded
This commit is contained in:
@@ -18,8 +18,8 @@ DankModal {
|
|||||||
property var tabNames: ["Processes", "Performance", "System"]
|
property var tabNames: ["Processes", "Performance", "System"]
|
||||||
|
|
||||||
function show() {
|
function show() {
|
||||||
if (!DankgopService.dankgopAvailable) {
|
if (!DgopService.dgopAvailable) {
|
||||||
console.warn("ProcessListModal: dankgop is not available")
|
console.warn("ProcessListModal: dgop is not available")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
processListModal.visible = true
|
processListModal.visible = true
|
||||||
@@ -33,8 +33,8 @@ DankModal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function toggle() {
|
function toggle() {
|
||||||
if (!DankgopService.dankgopAvailable) {
|
if (!DgopService.dgopAvailable) {
|
||||||
console.warn("ProcessListModal: dankgop is not available")
|
console.warn("ProcessListModal: dgop is not available")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (processListModal.visible)
|
if (processListModal.visible)
|
||||||
@@ -97,7 +97,7 @@ DankModal {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show error message when dankgop is not available
|
// Show error message when dgop is not available
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: 400
|
width: 400
|
||||||
@@ -106,7 +106,7 @@ DankModal {
|
|||||||
color: Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.1)
|
color: Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.1)
|
||||||
border.color: Theme.error
|
border.color: Theme.error
|
||||||
border.width: 2
|
border.width: 2
|
||||||
visible: !DankgopService.dankgopAvailable
|
visible: !DgopService.dgopAvailable
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
@@ -128,7 +128,7 @@ DankModal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: "The 'dankgop' tool is required for system monitoring.\nPlease install dankgop to use this feature."
|
text: "The 'dgop' tool is required for system monitoring.\nPlease install dgop to use this feature."
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
@@ -142,7 +142,7 @@ DankModal {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: Theme.spacingL
|
anchors.margins: Theme.spacingL
|
||||||
spacing: Theme.spacingL
|
spacing: Theme.spacingL
|
||||||
visible: DankgopService.dankgopAvailable
|
visible: DgopService.dgopAvailable
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ Rectangle {
|
|||||||
border.width: 1
|
border.width: 1
|
||||||
|
|
||||||
Ref {
|
Ref {
|
||||||
service: DankgopService
|
service: DgopService
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
@@ -36,7 +36,7 @@ Rectangle {
|
|||||||
spacing: Theme.spacingXS
|
spacing: Theme.spacingXS
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: DankgopService.hostname
|
text: DgopService.hostname
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
font.pixelSize: Theme.fontSizeLarge
|
||||||
font.weight: Font.Medium
|
font.weight: Font.Medium
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
@@ -45,7 +45,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: DankgopService.distribution + " • " + DankgopService.architecture
|
text: DgopService.distribution + " • " + DgopService.architecture
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
|
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
|
||||||
Theme.surfaceText.b, 0.7)
|
Theme.surfaceText.b, 0.7)
|
||||||
@@ -74,7 +74,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: "Load: " + DankgopService.loadAverage
|
text: "Load: " + DgopService.loadAverage
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
width: parent.width
|
width: parent.width
|
||||||
@@ -82,8 +82,8 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: DankgopService.processCount + " proc, "
|
text: DgopService.processCount + " proc, "
|
||||||
+ DankgopService.threadCount + " threads"
|
+ DgopService.threadCount + " threads"
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
|
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
|
||||||
Theme.surfaceText.b, 0.8)
|
Theme.surfaceText.b, 0.8)
|
||||||
|
|||||||
@@ -28,10 +28,10 @@ Column {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
spacing: Theme.spacingM
|
spacing: Theme.spacingM
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
DankgopService.addRef(["cpu", "memory", "network", "disk"])
|
DgopService.addRef(["cpu", "memory", "network", "disk"])
|
||||||
}
|
}
|
||||||
Component.onDestruction: {
|
Component.onDestruction: {
|
||||||
DankgopService.removeRef(["cpu", "memory", "network", "disk"])
|
DgopService.removeRef(["cpu", "memory", "network", "disk"])
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
@@ -71,7 +71,7 @@ Column {
|
|||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: DankgopService.cpuUsage.toFixed(1) + "%"
|
text: DgopService.cpuUsage.toFixed(1) + "%"
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
font.weight: Font.Bold
|
font.weight: Font.Bold
|
||||||
color: Theme.primary
|
color: Theme.primary
|
||||||
@@ -85,7 +85,7 @@ Column {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: DankgopService.cpuCores + " cores"
|
text: DgopService.cpuCores + " cores"
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
@@ -104,7 +104,7 @@ Column {
|
|||||||
spacing: 6
|
spacing: 6
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: DankgopService.perCoreCpuUsage
|
model: DgopService.perCoreCpuUsage
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
@@ -193,9 +193,9 @@ Column {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: DankgopService.formatSystemMemory(
|
text: DgopService.formatSystemMemory(
|
||||||
DankgopService.usedMemoryKB) + " / " + DankgopService.formatSystemMemory(
|
DgopService.usedMemoryKB) + " / " + DgopService.formatSystemMemory(
|
||||||
DankgopService.totalMemoryKB)
|
DgopService.totalMemoryKB)
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
}
|
}
|
||||||
@@ -218,15 +218,15 @@ Column {
|
|||||||
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
|
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
width: DankgopService.totalMemoryKB
|
width: DgopService.totalMemoryKB
|
||||||
> 0 ? parent.width * (DankgopService.usedMemoryKB
|
> 0 ? parent.width * (DgopService.usedMemoryKB
|
||||||
/ DankgopService.totalMemoryKB) : 0
|
/ DgopService.totalMemoryKB) : 0
|
||||||
height: parent.height
|
height: parent.height
|
||||||
radius: parent.radius
|
radius: parent.radius
|
||||||
color: {
|
color: {
|
||||||
const usage = DankgopService.totalMemoryKB
|
const usage = DgopService.totalMemoryKB
|
||||||
> 0 ? (DankgopService.usedMemoryKB
|
> 0 ? (DgopService.usedMemoryKB
|
||||||
/ DankgopService.totalMemoryKB) : 0
|
/ DgopService.totalMemoryKB) : 0
|
||||||
if (usage > 0.9)
|
if (usage > 0.9)
|
||||||
return Theme.error
|
return Theme.error
|
||||||
|
|
||||||
@@ -245,9 +245,9 @@ Column {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: DankgopService.totalMemoryKB
|
text: DgopService.totalMemoryKB
|
||||||
> 0 ? ((DankgopService.usedMemoryKB
|
> 0 ? ((DgopService.usedMemoryKB
|
||||||
/ DankgopService.totalMemoryKB) * 100).toFixed(
|
/ DgopService.totalMemoryKB) * 100).toFixed(
|
||||||
1) + "% used" : "No data"
|
1) + "% used" : "No data"
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
font.weight: Font.Bold
|
font.weight: Font.Bold
|
||||||
@@ -272,11 +272,11 @@ Column {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: DankgopService.totalSwapKB
|
text: DgopService.totalSwapKB
|
||||||
> 0 ? DankgopService.formatSystemMemory(
|
> 0 ? DgopService.formatSystemMemory(
|
||||||
DankgopService.usedSwapKB) + " / "
|
DgopService.usedSwapKB) + " / "
|
||||||
+ DankgopService.formatSystemMemory(
|
+ DgopService.formatSystemMemory(
|
||||||
DankgopService.totalSwapKB) : "No swap configured"
|
DgopService.totalSwapKB) : "No swap configured"
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
}
|
}
|
||||||
@@ -299,17 +299,17 @@ Column {
|
|||||||
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
|
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
width: DankgopService.totalSwapKB
|
width: DgopService.totalSwapKB
|
||||||
> 0 ? parent.width * (DankgopService.usedSwapKB
|
> 0 ? parent.width * (DgopService.usedSwapKB
|
||||||
/ DankgopService.totalSwapKB) : 0
|
/ DgopService.totalSwapKB) : 0
|
||||||
height: parent.height
|
height: parent.height
|
||||||
radius: parent.radius
|
radius: parent.radius
|
||||||
color: {
|
color: {
|
||||||
if (!DankgopService.totalSwapKB)
|
if (!DgopService.totalSwapKB)
|
||||||
return Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
|
return Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
|
||||||
Theme.surfaceText.b, 0.3)
|
Theme.surfaceText.b, 0.3)
|
||||||
|
|
||||||
const usage = DankgopService.usedSwapKB / DankgopService.totalSwapKB
|
const usage = DgopService.usedSwapKB / DgopService.totalSwapKB
|
||||||
if (usage > 0.9)
|
if (usage > 0.9)
|
||||||
return Theme.error
|
return Theme.error
|
||||||
|
|
||||||
@@ -328,9 +328,9 @@ Column {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: DankgopService.totalSwapKB
|
text: DgopService.totalSwapKB
|
||||||
> 0 ? ((DankgopService.usedSwapKB
|
> 0 ? ((DgopService.usedSwapKB
|
||||||
/ DankgopService.totalSwapKB) * 100).toFixed(
|
/ DgopService.totalSwapKB) * 100).toFixed(
|
||||||
1) + "% used" : "Not available"
|
1) + "% used" : "Not available"
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
font.weight: Font.Bold
|
font.weight: Font.Bold
|
||||||
@@ -381,9 +381,9 @@ Column {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: DankgopService.networkRxRate
|
text: DgopService.networkRxRate
|
||||||
> 0 ? formatNetworkSpeed(
|
> 0 ? formatNetworkSpeed(
|
||||||
DankgopService.networkRxRate) : "0 B/s"
|
DgopService.networkRxRate) : "0 B/s"
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
font.weight: Font.Bold
|
font.weight: Font.Bold
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
@@ -400,9 +400,9 @@ Column {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: DankgopService.networkTxRate
|
text: DgopService.networkTxRate
|
||||||
> 0 ? formatNetworkSpeed(
|
> 0 ? formatNetworkSpeed(
|
||||||
DankgopService.networkTxRate) : "0 B/s"
|
DgopService.networkTxRate) : "0 B/s"
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
font.weight: Font.Bold
|
font.weight: Font.Bold
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
@@ -448,7 +448,7 @@ Column {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: formatDiskSpeed(DankgopService.diskReadRate)
|
text: formatDiskSpeed(DgopService.diskReadRate)
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
font.weight: Font.Bold
|
font.weight: Font.Bold
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
@@ -465,7 +465,7 @@ Column {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: formatDiskSpeed(DankgopService.diskWriteRate)
|
text: formatDiskSpeed(DgopService.diskWriteRate)
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
font.weight: Font.Bold
|
font.weight: Font.Bold
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ Rectangle {
|
|||||||
DankIcon {
|
DankIcon {
|
||||||
id: processIcon
|
id: processIcon
|
||||||
|
|
||||||
name: DankgopService.getProcessIcon(process ? process.command : "")
|
name: DgopService.getProcessIcon(process ? process.command : "")
|
||||||
size: Theme.iconSize - 4
|
size: Theme.iconSize - 4
|
||||||
color: {
|
color: {
|
||||||
if (process && process.cpu > 80)
|
if (process && process.cpu > 80)
|
||||||
@@ -110,7 +110,7 @@ Rectangle {
|
|||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: DankgopService.formatCpuUsage(process ? process.cpu : 0)
|
text: DgopService.formatCpuUsage(process ? process.cpu : 0)
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
font.family: SettingsData.monoFontFamily
|
font.family: SettingsData.monoFontFamily
|
||||||
font.weight: Font.Bold
|
font.weight: Font.Bold
|
||||||
@@ -149,7 +149,7 @@ Rectangle {
|
|||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: DankgopService.formatMemoryUsage(
|
text: DgopService.formatMemoryUsage(
|
||||||
process ? process.memoryKB : 0)
|
process ? process.memoryKB : 0)
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
font.family: SettingsData.monoFontFamily
|
font.family: SettingsData.monoFontFamily
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ PanelWindow {
|
|||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
Ref {
|
Ref {
|
||||||
service: DankgopService
|
service: DgopService
|
||||||
}
|
}
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ Column {
|
|||||||
property var contextMenu: null
|
property var contextMenu: null
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
DankgopService.addRef(["processes"])
|
DgopService.addRef(["processes"])
|
||||||
}
|
}
|
||||||
Component.onDestruction: {
|
Component.onDestruction: {
|
||||||
DankgopService.removeRef(["processes"])
|
DgopService.removeRef(["processes"])
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
@@ -39,9 +39,9 @@ Column {
|
|||||||
text: "Process"
|
text: "Process"
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
font.family: SettingsData.monoFontFamily
|
font.family: SettingsData.monoFontFamily
|
||||||
font.weight: DankgopService.sortBy === "name" ? Font.Bold : Font.Medium
|
font.weight: DgopService.sortBy === "name" ? Font.Bold : Font.Medium
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
opacity: DankgopService.sortBy === "name" ? 1 : 0.7
|
opacity: DgopService.sortBy === "name" ? 1 : 0.7
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ Column {
|
|||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
DankgopService.setSortBy("name")
|
DgopService.setSortBy("name")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,9 +79,9 @@ Column {
|
|||||||
text: "CPU"
|
text: "CPU"
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
font.family: SettingsData.monoFontFamily
|
font.family: SettingsData.monoFontFamily
|
||||||
font.weight: DankgopService.sortBy === "cpu" ? Font.Bold : Font.Medium
|
font.weight: DgopService.sortBy === "cpu" ? Font.Bold : Font.Medium
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
opacity: DankgopService.sortBy === "cpu" ? 1 : 0.7
|
opacity: DgopService.sortBy === "cpu" ? 1 : 0.7
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ Column {
|
|||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
DankgopService.setSortBy("cpu")
|
DgopService.setSortBy("cpu")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,9 +119,9 @@ Column {
|
|||||||
text: "RAM"
|
text: "RAM"
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
font.family: SettingsData.monoFontFamily
|
font.family: SettingsData.monoFontFamily
|
||||||
font.weight: DankgopService.sortBy === "memory" ? Font.Bold : Font.Medium
|
font.weight: DgopService.sortBy === "memory" ? Font.Bold : Font.Medium
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
opacity: DankgopService.sortBy === "memory" ? 1 : 0.7
|
opacity: DgopService.sortBy === "memory" ? 1 : 0.7
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,7 +132,7 @@ Column {
|
|||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
DankgopService.setSortBy("memory")
|
DgopService.setSortBy("memory")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,9 +159,9 @@ Column {
|
|||||||
text: "PID"
|
text: "PID"
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
font.family: SettingsData.monoFontFamily
|
font.family: SettingsData.monoFontFamily
|
||||||
font.weight: DankgopService.sortBy === "pid" ? Font.Bold : Font.Medium
|
font.weight: DgopService.sortBy === "pid" ? Font.Bold : Font.Medium
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
opacity: DankgopService.sortBy === "pid" ? 1 : 0.7
|
opacity: DgopService.sortBy === "pid" ? 1 : 0.7
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
}
|
}
|
||||||
@@ -173,7 +173,7 @@ Column {
|
|||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
DankgopService.setSortBy("pid")
|
DgopService.setSortBy("pid")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,7 +197,7 @@ Column {
|
|||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: DankgopService.sortDescending ? "↓" : "↑"
|
text: DgopService.sortDescending ? "↓" : "↑"
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
@@ -210,7 +210,7 @@ Column {
|
|||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
// ! TODO - we lost this with dankgop
|
// ! TODO - we lost this with dgop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -231,7 +231,7 @@ Column {
|
|||||||
height: parent.height - columnHeaders.height
|
height: parent.height - columnHeaders.height
|
||||||
clip: true
|
clip: true
|
||||||
spacing: 4
|
spacing: 4
|
||||||
model: DankgopService.processes
|
model: DgopService.processes
|
||||||
|
|
||||||
delegate: ProcessListItem {
|
delegate: ProcessListItem {
|
||||||
process: modelData
|
process: modelData
|
||||||
|
|||||||
@@ -8,10 +8,10 @@ Row {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
spacing: Theme.spacingM
|
spacing: Theme.spacingM
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
DankgopService.addRef(["cpu", "memory", "system"]);
|
DgopService.addRef(["cpu", "memory", "system"]);
|
||||||
}
|
}
|
||||||
Component.onDestruction: {
|
Component.onDestruction: {
|
||||||
DankgopService.removeRef(["cpu", "memory", "system"]);
|
DgopService.removeRef(["cpu", "memory", "system"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
@@ -19,15 +19,15 @@ Row {
|
|||||||
height: 80
|
height: 80
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
color: {
|
color: {
|
||||||
if (DankgopService.sortBy === "cpu")
|
if (DgopService.sortBy === "cpu")
|
||||||
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.16);
|
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.16);
|
||||||
else if (cpuCardMouseArea.containsMouse)
|
else if (cpuCardMouseArea.containsMouse)
|
||||||
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12);
|
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12);
|
||||||
else
|
else
|
||||||
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08);
|
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08);
|
||||||
}
|
}
|
||||||
border.color: DankgopService.sortBy === "cpu" ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.4) : Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.2)
|
border.color: DgopService.sortBy === "cpu" ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.4) : Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.2)
|
||||||
border.width: DankgopService.sortBy === "cpu" ? 2 : 1
|
border.width: DgopService.sortBy === "cpu" ? 2 : 1
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: cpuCardMouseArea
|
id: cpuCardMouseArea
|
||||||
@@ -35,7 +35,7 @@ Row {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: DankgopService.setSortBy("cpu")
|
onClicked: DgopService.setSortBy("cpu")
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
@@ -48,8 +48,8 @@ Row {
|
|||||||
text: "CPU"
|
text: "CPU"
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
font.weight: Font.Medium
|
font.weight: Font.Medium
|
||||||
color: DankgopService.sortBy === "cpu" ? Theme.primary : Theme.secondary
|
color: DgopService.sortBy === "cpu" ? Theme.primary : Theme.secondary
|
||||||
opacity: DankgopService.sortBy === "cpu" ? 1 : 0.8
|
opacity: DgopService.sortBy === "cpu" ? 1 : 0.8
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
@@ -57,9 +57,9 @@ Row {
|
|||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: {
|
text: {
|
||||||
if (DankgopService.cpuUsage === undefined || DankgopService.cpuUsage === null)
|
if (DgopService.cpuUsage === undefined || DgopService.cpuUsage === null)
|
||||||
return "--%"
|
return "--%"
|
||||||
return DankgopService.cpuUsage.toFixed(1) + "%"
|
return DgopService.cpuUsage.toFixed(1) + "%"
|
||||||
}
|
}
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
font.pixelSize: Theme.fontSizeLarge
|
||||||
font.family: SettingsData.monoFontFamily
|
font.family: SettingsData.monoFontFamily
|
||||||
@@ -77,19 +77,19 @@ Row {
|
|||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: {
|
text: {
|
||||||
if (DankgopService.cpuTemperature === undefined || DankgopService.cpuTemperature === null || DankgopService.cpuTemperature <= 0)
|
if (DgopService.cpuTemperature === undefined || DgopService.cpuTemperature === null || DgopService.cpuTemperature <= 0)
|
||||||
return "--°";
|
return "--°";
|
||||||
|
|
||||||
return Math.round(DankgopService.cpuTemperature) + "°";
|
return Math.round(DgopService.cpuTemperature) + "°";
|
||||||
}
|
}
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
font.family: SettingsData.monoFontFamily
|
font.family: SettingsData.monoFontFamily
|
||||||
font.weight: Font.Medium
|
font.weight: Font.Medium
|
||||||
color: {
|
color: {
|
||||||
if (DankgopService.cpuTemperature > 80)
|
if (DgopService.cpuTemperature > 80)
|
||||||
return Theme.error;
|
return Theme.error;
|
||||||
|
|
||||||
if (DankgopService.cpuTemperature > 60)
|
if (DgopService.cpuTemperature > 60)
|
||||||
return Theme.warning;
|
return Theme.warning;
|
||||||
|
|
||||||
return Theme.surfaceText;
|
return Theme.surfaceText;
|
||||||
@@ -100,7 +100,7 @@ Row {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: DankgopService.cpuCores + " cores"
|
text: DgopService.cpuCores + " cores"
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
font.family: SettingsData.monoFontFamily
|
font.family: SettingsData.monoFontFamily
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
@@ -130,15 +130,15 @@ Row {
|
|||||||
height: 80
|
height: 80
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
color: {
|
color: {
|
||||||
if (DankgopService.sortBy === "memory")
|
if (DgopService.sortBy === "memory")
|
||||||
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.16);
|
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.16);
|
||||||
else if (memoryCardMouseArea.containsMouse)
|
else if (memoryCardMouseArea.containsMouse)
|
||||||
return Qt.rgba(Theme.secondary.r, Theme.secondary.g, Theme.secondary.b, 0.12);
|
return Qt.rgba(Theme.secondary.r, Theme.secondary.g, Theme.secondary.b, 0.12);
|
||||||
else
|
else
|
||||||
return Qt.rgba(Theme.secondary.r, Theme.secondary.g, Theme.secondary.b, 0.08);
|
return Qt.rgba(Theme.secondary.r, Theme.secondary.g, Theme.secondary.b, 0.08);
|
||||||
}
|
}
|
||||||
border.color: DankgopService.sortBy === "memory" ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.4) : Qt.rgba(Theme.secondary.r, Theme.secondary.g, Theme.secondary.b, 0.2)
|
border.color: DgopService.sortBy === "memory" ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.4) : Qt.rgba(Theme.secondary.r, Theme.secondary.g, Theme.secondary.b, 0.2)
|
||||||
border.width: DankgopService.sortBy === "memory" ? 2 : 1
|
border.width: DgopService.sortBy === "memory" ? 2 : 1
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: memoryCardMouseArea
|
id: memoryCardMouseArea
|
||||||
@@ -146,7 +146,7 @@ Row {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: DankgopService.setSortBy("memory")
|
onClicked: DgopService.setSortBy("memory")
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
@@ -159,15 +159,15 @@ Row {
|
|||||||
text: "Memory"
|
text: "Memory"
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
font.weight: Font.Medium
|
font.weight: Font.Medium
|
||||||
color: DankgopService.sortBy === "memory" ? Theme.primary : Theme.secondary
|
color: DgopService.sortBy === "memory" ? Theme.primary : Theme.secondary
|
||||||
opacity: DankgopService.sortBy === "memory" ? 1 : 0.8
|
opacity: DgopService.sortBy === "memory" ? 1 : 0.8
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
spacing: Theme.spacingS
|
spacing: Theme.spacingS
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: DankgopService.formatSystemMemory(DankgopService.usedMemoryKB)
|
text: DgopService.formatSystemMemory(DgopService.usedMemoryKB)
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
font.pixelSize: Theme.fontSizeLarge
|
||||||
font.family: SettingsData.monoFontFamily
|
font.family: SettingsData.monoFontFamily
|
||||||
font.weight: Font.Bold
|
font.weight: Font.Bold
|
||||||
@@ -180,27 +180,27 @@ Row {
|
|||||||
height: 20
|
height: 20
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.3)
|
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.3)
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
visible: DankgopService.totalSwapKB > 0
|
visible: DgopService.totalSwapKB > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: DankgopService.totalSwapKB > 0 ? DankgopService.formatSystemMemory(DankgopService.usedSwapKB) : ""
|
text: DgopService.totalSwapKB > 0 ? DgopService.formatSystemMemory(DgopService.usedSwapKB) : ""
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
font.family: SettingsData.monoFontFamily
|
font.family: SettingsData.monoFontFamily
|
||||||
font.weight: Font.Medium
|
font.weight: Font.Medium
|
||||||
color: DankgopService.usedSwapKB > 0 ? Theme.warning : Theme.surfaceText
|
color: DgopService.usedSwapKB > 0 ? Theme.warning : Theme.surfaceText
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
visible: DankgopService.totalSwapKB > 0
|
visible: DgopService.totalSwapKB > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: {
|
text: {
|
||||||
if (DankgopService.totalSwapKB > 0)
|
if (DgopService.totalSwapKB > 0)
|
||||||
return "of " + DankgopService.formatSystemMemory(DankgopService.totalMemoryKB) + " + swap";
|
return "of " + DgopService.formatSystemMemory(DgopService.totalMemoryKB) + " + swap";
|
||||||
|
|
||||||
return "of " + DankgopService.formatSystemMemory(DankgopService.totalMemoryKB);
|
return "of " + DgopService.formatSystemMemory(DgopService.totalMemoryKB);
|
||||||
}
|
}
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
font.family: SettingsData.monoFontFamily
|
font.family: SettingsData.monoFontFamily
|
||||||
@@ -231,40 +231,40 @@ Row {
|
|||||||
height: 80
|
height: 80
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
color: {
|
color: {
|
||||||
if (!DankgopService.availableGpus || DankgopService.availableGpus.length === 0) {
|
if (!DgopService.availableGpus || DgopService.availableGpus.length === 0) {
|
||||||
if (gpuCardMouseArea.containsMouse && DankgopService.availableGpus.length > 1)
|
if (gpuCardMouseArea.containsMouse && DgopService.availableGpus.length > 1)
|
||||||
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.16);
|
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.16);
|
||||||
else
|
else
|
||||||
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.08);
|
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.08);
|
||||||
}
|
}
|
||||||
var gpu = DankgopService.availableGpus[Math.min(SessionData.selectedGpuIndex, DankgopService.availableGpus.length - 1)];
|
var gpu = DgopService.availableGpus[Math.min(SessionData.selectedGpuIndex, DgopService.availableGpus.length - 1)];
|
||||||
var vendor = gpu.vendor.toLowerCase();
|
var vendor = gpu.vendor.toLowerCase();
|
||||||
if (vendor.includes("nvidia")) {
|
if (vendor.includes("nvidia")) {
|
||||||
if (gpuCardMouseArea.containsMouse && DankgopService.availableGpus.length > 1)
|
if (gpuCardMouseArea.containsMouse && DgopService.availableGpus.length > 1)
|
||||||
return Qt.rgba(Theme.success.r, Theme.success.g, Theme.success.b, 0.2);
|
return Qt.rgba(Theme.success.r, Theme.success.g, Theme.success.b, 0.2);
|
||||||
else
|
else
|
||||||
return Qt.rgba(Theme.success.r, Theme.success.g, Theme.success.b, 0.12);
|
return Qt.rgba(Theme.success.r, Theme.success.g, Theme.success.b, 0.12);
|
||||||
} else if (vendor.includes("amd")) {
|
} else if (vendor.includes("amd")) {
|
||||||
if (gpuCardMouseArea.containsMouse && DankgopService.availableGpus.length > 1)
|
if (gpuCardMouseArea.containsMouse && DgopService.availableGpus.length > 1)
|
||||||
return Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.2);
|
return Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.2);
|
||||||
else
|
else
|
||||||
return Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.12);
|
return Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.12);
|
||||||
} else if (vendor.includes("intel")) {
|
} else if (vendor.includes("intel")) {
|
||||||
if (gpuCardMouseArea.containsMouse && DankgopService.availableGpus.length > 1)
|
if (gpuCardMouseArea.containsMouse && DgopService.availableGpus.length > 1)
|
||||||
return Qt.rgba(Theme.info.r, Theme.info.g, Theme.info.b, 0.2);
|
return Qt.rgba(Theme.info.r, Theme.info.g, Theme.info.b, 0.2);
|
||||||
else
|
else
|
||||||
return Qt.rgba(Theme.info.r, Theme.info.g, Theme.info.b, 0.12);
|
return Qt.rgba(Theme.info.r, Theme.info.g, Theme.info.b, 0.12);
|
||||||
}
|
}
|
||||||
if (gpuCardMouseArea.containsMouse && DankgopService.availableGpus.length > 1)
|
if (gpuCardMouseArea.containsMouse && DgopService.availableGpus.length > 1)
|
||||||
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.16);
|
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.16);
|
||||||
else
|
else
|
||||||
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.08);
|
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.08);
|
||||||
}
|
}
|
||||||
border.color: {
|
border.color: {
|
||||||
if (!DankgopService.availableGpus || DankgopService.availableGpus.length === 0)
|
if (!DgopService.availableGpus || DgopService.availableGpus.length === 0)
|
||||||
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.2);
|
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.2);
|
||||||
|
|
||||||
var gpu = DankgopService.availableGpus[Math.min(SessionData.selectedGpuIndex, DankgopService.availableGpus.length - 1)];
|
var gpu = DgopService.availableGpus[Math.min(SessionData.selectedGpuIndex, DgopService.availableGpus.length - 1)];
|
||||||
var vendor = gpu.vendor.toLowerCase();
|
var vendor = gpu.vendor.toLowerCase();
|
||||||
if (vendor.includes("nvidia"))
|
if (vendor.includes("nvidia"))
|
||||||
return Qt.rgba(Theme.success.r, Theme.success.g, Theme.success.b, 0.3);
|
return Qt.rgba(Theme.success.r, Theme.success.g, Theme.success.b, 0.3);
|
||||||
@@ -282,11 +282,11 @@ Row {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||||
cursorShape: DankgopService.availableGpus.length > 1 ? Qt.PointingHandCursor : Qt.ArrowCursor
|
cursorShape: DgopService.availableGpus.length > 1 ? Qt.PointingHandCursor : Qt.ArrowCursor
|
||||||
onClicked: (mouse) => {
|
onClicked: (mouse) => {
|
||||||
if (mouse.button === Qt.LeftButton) {
|
if (mouse.button === Qt.LeftButton) {
|
||||||
if (DankgopService.availableGpus.length > 1) {
|
if (DgopService.availableGpus.length > 1) {
|
||||||
var nextIndex = (SessionData.selectedGpuIndex + 1) % DankgopService.availableGpus.length;
|
var nextIndex = (SessionData.selectedGpuIndex + 1) % DgopService.availableGpus.length;
|
||||||
SessionData.setSelectedGpuIndex(nextIndex);
|
SessionData.setSelectedGpuIndex(nextIndex);
|
||||||
}
|
}
|
||||||
} else if (mouse.button === Qt.RightButton) {
|
} else if (mouse.button === Qt.RightButton) {
|
||||||
@@ -311,10 +311,10 @@ Row {
|
|||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: {
|
text: {
|
||||||
if (!DankgopService.availableGpus || DankgopService.availableGpus.length === 0)
|
if (!DgopService.availableGpus || DgopService.availableGpus.length === 0)
|
||||||
return "No GPU";
|
return "No GPU";
|
||||||
|
|
||||||
var gpu = DankgopService.availableGpus[Math.min(SessionData.selectedGpuIndex, DankgopService.availableGpus.length - 1)];
|
var gpu = DgopService.availableGpus[Math.min(SessionData.selectedGpuIndex, DgopService.availableGpus.length - 1)];
|
||||||
// Check if temperature monitoring is enabled for this GPU
|
// Check if temperature monitoring is enabled for this GPU
|
||||||
var tempEnabled = SessionData.enabledGpuPciIds && SessionData.enabledGpuPciIds.indexOf(gpu.pciId) !== -1;
|
var tempEnabled = SessionData.enabledGpuPciIds && SessionData.enabledGpuPciIds.indexOf(gpu.pciId) !== -1;
|
||||||
var temp = gpu.temperature;
|
var temp = gpu.temperature;
|
||||||
@@ -328,10 +328,10 @@ Row {
|
|||||||
font.family: SettingsData.monoFontFamily
|
font.family: SettingsData.monoFontFamily
|
||||||
font.weight: Font.Bold
|
font.weight: Font.Bold
|
||||||
color: {
|
color: {
|
||||||
if (!DankgopService.availableGpus || DankgopService.availableGpus.length === 0)
|
if (!DgopService.availableGpus || DgopService.availableGpus.length === 0)
|
||||||
return Theme.surfaceText;
|
return Theme.surfaceText;
|
||||||
|
|
||||||
var gpu = DankgopService.availableGpus[Math.min(SessionData.selectedGpuIndex, DankgopService.availableGpus.length - 1)];
|
var gpu = DgopService.availableGpus[Math.min(SessionData.selectedGpuIndex, DgopService.availableGpus.length - 1)];
|
||||||
var tempEnabled = SessionData.enabledGpuPciIds && SessionData.enabledGpuPciIds.indexOf(gpu.pciId) !== -1;
|
var tempEnabled = SessionData.enabledGpuPciIds && SessionData.enabledGpuPciIds.indexOf(gpu.pciId) !== -1;
|
||||||
var temp = gpu.temperature || 0;
|
var temp = gpu.temperature || 0;
|
||||||
if (tempEnabled && temp > 80)
|
if (tempEnabled && temp > 80)
|
||||||
@@ -346,10 +346,10 @@ Row {
|
|||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: {
|
text: {
|
||||||
if (!DankgopService.availableGpus || DankgopService.availableGpus.length === 0)
|
if (!DgopService.availableGpus || DgopService.availableGpus.length === 0)
|
||||||
return "No GPUs detected";
|
return "No GPUs detected";
|
||||||
|
|
||||||
var gpu = DankgopService.availableGpus[Math.min(SessionData.selectedGpuIndex, DankgopService.availableGpus.length - 1)];
|
var gpu = DgopService.availableGpus[Math.min(SessionData.selectedGpuIndex, DgopService.availableGpus.length - 1)];
|
||||||
var tempEnabled = SessionData.enabledGpuPciIds && SessionData.enabledGpuPciIds.indexOf(gpu.pciId) !== -1;
|
var tempEnabled = SessionData.enabledGpuPciIds && SessionData.enabledGpuPciIds.indexOf(gpu.pciId) !== -1;
|
||||||
var temp = gpu.temperature;
|
var temp = gpu.temperature;
|
||||||
var hasTemp = tempEnabled && temp !== undefined && temp !== null && temp !== 0;
|
var hasTemp = tempEnabled && temp !== undefined && temp !== null && temp !== 0;
|
||||||
@@ -376,21 +376,21 @@ Row {
|
|||||||
text: "Enable GPU Temperature"
|
text: "Enable GPU Temperature"
|
||||||
checkable: true
|
checkable: true
|
||||||
checked: {
|
checked: {
|
||||||
if (!DankgopService.availableGpus || DankgopService.availableGpus.length === 0) {
|
if (!DgopService.availableGpus || DgopService.availableGpus.length === 0) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
var gpu = DankgopService.availableGpus[Math.min(SessionData.selectedGpuIndex, DankgopService.availableGpus.length - 1)]
|
var gpu = DgopService.availableGpus[Math.min(SessionData.selectedGpuIndex, DgopService.availableGpus.length - 1)]
|
||||||
if (!gpu.pciId) return false
|
if (!gpu.pciId) return false
|
||||||
|
|
||||||
return SessionData.enabledGpuPciIds ? SessionData.enabledGpuPciIds.indexOf(gpu.pciId) !== -1 : false
|
return SessionData.enabledGpuPciIds ? SessionData.enabledGpuPciIds.indexOf(gpu.pciId) !== -1 : false
|
||||||
}
|
}
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
if (!DankgopService.availableGpus || DankgopService.availableGpus.length === 0) {
|
if (!DgopService.availableGpus || DgopService.availableGpus.length === 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
var gpu = DankgopService.availableGpus[Math.min(SessionData.selectedGpuIndex, DankgopService.availableGpus.length - 1)]
|
var gpu = DgopService.availableGpus[Math.min(SessionData.selectedGpuIndex, DgopService.availableGpus.length - 1)]
|
||||||
if (!gpu.pciId) return
|
if (!gpu.pciId) return
|
||||||
|
|
||||||
var enabledIds = SessionData.enabledGpuPciIds ? SessionData.enabledGpuPciIds.slice() : []
|
var enabledIds = SessionData.enabledGpuPciIds ? SessionData.enabledGpuPciIds.slice() : []
|
||||||
@@ -398,10 +398,10 @@ Row {
|
|||||||
|
|
||||||
if (checked && index === -1) {
|
if (checked && index === -1) {
|
||||||
enabledIds.push(gpu.pciId)
|
enabledIds.push(gpu.pciId)
|
||||||
DankgopService.addGpuPciId(gpu.pciId)
|
DgopService.addGpuPciId(gpu.pciId)
|
||||||
} else if (!checked && index !== -1) {
|
} else if (!checked && index !== -1) {
|
||||||
enabledIds.splice(index, 1)
|
enabledIds.splice(index, 1)
|
||||||
DankgopService.removeGpuPciId(gpu.pciId)
|
DgopService.removeGpuPciId(gpu.pciId)
|
||||||
}
|
}
|
||||||
|
|
||||||
SessionData.setEnabledGpuPciIds(enabledIds)
|
SessionData.setEnabledGpuPciIds(enabledIds)
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ ScrollView {
|
|||||||
ScrollBar.vertical.policy: ScrollBar.AsNeeded
|
ScrollBar.vertical.policy: ScrollBar.AsNeeded
|
||||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
DankgopService.addRef(["system", "hardware", "diskmounts"])
|
DgopService.addRef(["system", "hardware", "diskmounts"])
|
||||||
}
|
}
|
||||||
Component.onDestruction: {
|
Component.onDestruction: {
|
||||||
DankgopService.removeRef(["system", "hardware", "diskmounts"])
|
DgopService.removeRef(["system", "hardware", "diskmounts"])
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
@@ -52,7 +52,7 @@ ScrollView {
|
|||||||
spacing: Theme.spacingS
|
spacing: Theme.spacingS
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: DankgopService.hostname
|
text: DgopService.hostname
|
||||||
font.pixelSize: Theme.fontSizeXLarge
|
font.pixelSize: Theme.fontSizeXLarge
|
||||||
font.family: SettingsData.monoFontFamily
|
font.family: SettingsData.monoFontFamily
|
||||||
font.weight: Font.Light
|
font.weight: Font.Light
|
||||||
@@ -61,8 +61,8 @@ ScrollView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: DankgopService.distribution + " • " + DankgopService.architecture
|
text: DgopService.distribution + " • " + DgopService.architecture
|
||||||
+ " • " + DankgopService.kernelVersion
|
+ " • " + DgopService.kernelVersion
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
font.family: SettingsData.monoFontFamily
|
font.family: SettingsData.monoFontFamily
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
|
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
|
||||||
@@ -71,7 +71,7 @@ ScrollView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: "Up " + UserInfoService.uptime + " • Boot: " + DankgopService.bootTime
|
text: "Up " + UserInfoService.uptime + " • Boot: " + DgopService.bootTime
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
font.family: SettingsData.monoFontFamily
|
font.family: SettingsData.monoFontFamily
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
|
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
|
||||||
@@ -80,9 +80,9 @@ ScrollView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: "Load: " + DankgopService.loadAverage + " • "
|
text: "Load: " + DgopService.loadAverage + " • "
|
||||||
+ DankgopService.processCount + " processes, "
|
+ DgopService.processCount + " processes, "
|
||||||
+ DankgopService.threadCount + " threads"
|
+ DgopService.threadCount + " threads"
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
font.family: SettingsData.monoFontFamily
|
font.family: SettingsData.monoFontFamily
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
|
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
|
||||||
@@ -144,7 +144,7 @@ ScrollView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: DankgopService.cpuModel
|
text: DgopService.cpuModel
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
font.family: SettingsData.monoFontFamily
|
font.family: SettingsData.monoFontFamily
|
||||||
font.weight: Font.Medium
|
font.weight: Font.Medium
|
||||||
@@ -157,7 +157,7 @@ ScrollView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: DankgopService.motherboard
|
text: DgopService.motherboard
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
font.family: SettingsData.monoFontFamily
|
font.family: SettingsData.monoFontFamily
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
|
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
|
||||||
@@ -170,7 +170,7 @@ ScrollView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: "BIOS " + DankgopService.biosVersion
|
text: "BIOS " + DgopService.biosVersion
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
font.family: SettingsData.monoFontFamily
|
font.family: SettingsData.monoFontFamily
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
|
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
|
||||||
@@ -181,8 +181,8 @@ ScrollView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: DankgopService.formatSystemMemory(
|
text: DgopService.formatSystemMemory(
|
||||||
DankgopService.totalMemoryKB) + " RAM"
|
DgopService.totalMemoryKB) + " RAM"
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
font.family: SettingsData.monoFontFamily
|
font.family: SettingsData.monoFontFamily
|
||||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
|
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
|
||||||
@@ -206,11 +206,11 @@ ScrollView {
|
|||||||
Theme.surfaceContainerHigh.g,
|
Theme.surfaceContainerHigh.g,
|
||||||
Theme.surfaceContainerHigh.b, 0.6)
|
Theme.surfaceContainerHigh.b, 0.6)
|
||||||
|
|
||||||
if (!DankgopService.availableGpus || DankgopService.availableGpus.length === 0) {
|
if (!DgopService.availableGpus || DgopService.availableGpus.length === 0) {
|
||||||
return gpuCardMouseArea.containsMouse && DankgopService.availableGpus.length > 1 ? hoverColor : baseColor
|
return gpuCardMouseArea.containsMouse && DgopService.availableGpus.length > 1 ? hoverColor : baseColor
|
||||||
}
|
}
|
||||||
|
|
||||||
var gpu = DankgopService.availableGpus[Math.min(SessionData.selectedGpuIndex, DankgopService.availableGpus.length - 1)]
|
var gpu = DgopService.availableGpus[Math.min(SessionData.selectedGpuIndex, DgopService.availableGpus.length - 1)]
|
||||||
var vendor = gpu.fullName.split(' ')[0].toLowerCase()
|
var vendor = gpu.fullName.split(' ')[0].toLowerCase()
|
||||||
var tintColor
|
var tintColor
|
||||||
|
|
||||||
@@ -221,10 +221,10 @@ ScrollView {
|
|||||||
} else if (vendor.includes("intel")) {
|
} else if (vendor.includes("intel")) {
|
||||||
tintColor = Theme.info
|
tintColor = Theme.info
|
||||||
} else {
|
} else {
|
||||||
return gpuCardMouseArea.containsMouse && DankgopService.availableGpus.length > 1 ? hoverColor : baseColor
|
return gpuCardMouseArea.containsMouse && DgopService.availableGpus.length > 1 ? hoverColor : baseColor
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gpuCardMouseArea.containsMouse && DankgopService.availableGpus.length > 1) {
|
if (gpuCardMouseArea.containsMouse && DgopService.availableGpus.length > 1) {
|
||||||
return Qt.rgba((hoverColor.r + tintColor.r * 0.1) / 1.1,
|
return Qt.rgba((hoverColor.r + tintColor.r * 0.1) / 1.1,
|
||||||
(hoverColor.g + tintColor.g * 0.1) / 1.1,
|
(hoverColor.g + tintColor.g * 0.1) / 1.1,
|
||||||
(hoverColor.b + tintColor.b * 0.1) / 1.1, 0.6)
|
(hoverColor.b + tintColor.b * 0.1) / 1.1, 0.6)
|
||||||
@@ -236,11 +236,11 @@ ScrollView {
|
|||||||
}
|
}
|
||||||
border.width: 1
|
border.width: 1
|
||||||
border.color: {
|
border.color: {
|
||||||
if (!DankgopService.availableGpus || DankgopService.availableGpus.length === 0) {
|
if (!DgopService.availableGpus || DgopService.availableGpus.length === 0) {
|
||||||
return Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.1)
|
return Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.1)
|
||||||
}
|
}
|
||||||
|
|
||||||
var gpu = DankgopService.availableGpus[Math.min(SessionData.selectedGpuIndex, DankgopService.availableGpus.length - 1)]
|
var gpu = DgopService.availableGpus[Math.min(SessionData.selectedGpuIndex, DgopService.availableGpus.length - 1)]
|
||||||
var vendor = gpu.fullName.split(' ')[0].toLowerCase()
|
var vendor = gpu.fullName.split(' ')[0].toLowerCase()
|
||||||
|
|
||||||
if (vendor.includes("nvidia")) {
|
if (vendor.includes("nvidia")) {
|
||||||
@@ -258,12 +258,12 @@ ScrollView {
|
|||||||
id: gpuCardMouseArea
|
id: gpuCardMouseArea
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: DankgopService.availableGpus.length
|
cursorShape: DgopService.availableGpus.length
|
||||||
> 1 ? Qt.PointingHandCursor : Qt.ArrowCursor
|
> 1 ? Qt.PointingHandCursor : Qt.ArrowCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (DankgopService.availableGpus.length > 1) {
|
if (DgopService.availableGpus.length > 1) {
|
||||||
var nextIndex = (SessionData.selectedGpuIndex + 1)
|
var nextIndex = (SessionData.selectedGpuIndex + 1)
|
||||||
% DankgopService.availableGpus.length
|
% DgopService.availableGpus.length
|
||||||
SessionData.setSelectedGpuIndex(nextIndex)
|
SessionData.setSelectedGpuIndex(nextIndex)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -301,13 +301,13 @@ ScrollView {
|
|||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: {
|
text: {
|
||||||
if (!DankgopService.availableGpus
|
if (!DgopService.availableGpus
|
||||||
|| DankgopService.availableGpus.length === 0) {
|
|| DgopService.availableGpus.length === 0) {
|
||||||
return "No GPUs detected"
|
return "No GPUs detected"
|
||||||
}
|
}
|
||||||
var gpu = DankgopService.availableGpus[Math.min(
|
var gpu = DgopService.availableGpus[Math.min(
|
||||||
SessionData.selectedGpuIndex,
|
SessionData.selectedGpuIndex,
|
||||||
DankgopService.availableGpus.length
|
DgopService.availableGpus.length
|
||||||
- 1)]
|
- 1)]
|
||||||
return gpu.fullName
|
return gpu.fullName
|
||||||
}
|
}
|
||||||
@@ -323,13 +323,13 @@ ScrollView {
|
|||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: {
|
text: {
|
||||||
if (!DankgopService.availableGpus
|
if (!DgopService.availableGpus
|
||||||
|| DankgopService.availableGpus.length === 0) {
|
|| DgopService.availableGpus.length === 0) {
|
||||||
return "Device: N/A"
|
return "Device: N/A"
|
||||||
}
|
}
|
||||||
var gpu = DankgopService.availableGpus[Math.min(
|
var gpu = DgopService.availableGpus[Math.min(
|
||||||
SessionData.selectedGpuIndex,
|
SessionData.selectedGpuIndex,
|
||||||
DankgopService.availableGpus.length
|
DgopService.availableGpus.length
|
||||||
- 1)]
|
- 1)]
|
||||||
return "Device: " + gpu.pciId
|
return "Device: " + gpu.pciId
|
||||||
}
|
}
|
||||||
@@ -345,13 +345,13 @@ ScrollView {
|
|||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: {
|
text: {
|
||||||
if (!DankgopService.availableGpus
|
if (!DgopService.availableGpus
|
||||||
|| DankgopService.availableGpus.length === 0) {
|
|| DgopService.availableGpus.length === 0) {
|
||||||
return "Driver: N/A"
|
return "Driver: N/A"
|
||||||
}
|
}
|
||||||
var gpu = DankgopService.availableGpus[Math.min(
|
var gpu = DgopService.availableGpus[Math.min(
|
||||||
SessionData.selectedGpuIndex,
|
SessionData.selectedGpuIndex,
|
||||||
DankgopService.availableGpus.length
|
DgopService.availableGpus.length
|
||||||
- 1)]
|
- 1)]
|
||||||
return "Driver: " + gpu.driver
|
return "Driver: " + gpu.driver
|
||||||
}
|
}
|
||||||
@@ -366,13 +366,13 @@ ScrollView {
|
|||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: {
|
text: {
|
||||||
if (!DankgopService.availableGpus
|
if (!DgopService.availableGpus
|
||||||
|| DankgopService.availableGpus.length === 0) {
|
|| DgopService.availableGpus.length === 0) {
|
||||||
return "Temp: --°"
|
return "Temp: --°"
|
||||||
}
|
}
|
||||||
var gpu = DankgopService.availableGpus[Math.min(
|
var gpu = DgopService.availableGpus[Math.min(
|
||||||
SessionData.selectedGpuIndex,
|
SessionData.selectedGpuIndex,
|
||||||
DankgopService.availableGpus.length
|
DgopService.availableGpus.length
|
||||||
- 1)]
|
- 1)]
|
||||||
var temp = gpu.temperature
|
var temp = gpu.temperature
|
||||||
return "Temp: " + ((temp === undefined || temp === null
|
return "Temp: " + ((temp === undefined || temp === null
|
||||||
@@ -382,14 +382,14 @@ ScrollView {
|
|||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
font.family: SettingsData.monoFontFamily
|
font.family: SettingsData.monoFontFamily
|
||||||
color: {
|
color: {
|
||||||
if (!DankgopService.availableGpus
|
if (!DgopService.availableGpus
|
||||||
|| DankgopService.availableGpus.length === 0) {
|
|| DgopService.availableGpus.length === 0) {
|
||||||
return Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
|
return Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
|
||||||
Theme.surfaceText.b, 0.7)
|
Theme.surfaceText.b, 0.7)
|
||||||
}
|
}
|
||||||
var gpu = DankgopService.availableGpus[Math.min(
|
var gpu = DgopService.availableGpus[Math.min(
|
||||||
SessionData.selectedGpuIndex,
|
SessionData.selectedGpuIndex,
|
||||||
DankgopService.availableGpus.length
|
DgopService.availableGpus.length
|
||||||
- 1)]
|
- 1)]
|
||||||
var temp = gpu.temperature || 0
|
var temp = gpu.temperature || 0
|
||||||
if (temp > 80)
|
if (temp > 80)
|
||||||
@@ -532,7 +532,7 @@ ScrollView {
|
|||||||
Repeater {
|
Repeater {
|
||||||
id: diskMountRepeater
|
id: diskMountRepeater
|
||||||
|
|
||||||
model: DankgopService.diskMounts
|
model: DgopService.diskMounts
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|||||||
@@ -54,29 +54,29 @@ Item {
|
|||||||
"text": "CPU Usage",
|
"text": "CPU Usage",
|
||||||
"description": "CPU usage indicator",
|
"description": "CPU usage indicator",
|
||||||
"icon": "memory",
|
"icon": "memory",
|
||||||
"enabled": DankgopService.dankgopAvailable,
|
"enabled": DgopService.dgopAvailable,
|
||||||
"warning": !DankgopService.dankgopAvailable ? "Requires 'dankgop' tool" : undefined
|
"warning": !DgopService.dgopAvailable ? "Requires 'dgop' tool" : undefined
|
||||||
}, {
|
}, {
|
||||||
"id": "memUsage",
|
"id": "memUsage",
|
||||||
"text": "Memory Usage",
|
"text": "Memory Usage",
|
||||||
"description": "Memory usage indicator",
|
"description": "Memory usage indicator",
|
||||||
"icon": "storage",
|
"icon": "storage",
|
||||||
"enabled": DankgopService.dankgopAvailable,
|
"enabled": DgopService.dgopAvailable,
|
||||||
"warning": !DankgopService.dankgopAvailable ? "Requires 'dankgop' tool" : undefined
|
"warning": !DgopService.dgopAvailable ? "Requires 'dgop' tool" : undefined
|
||||||
}, {
|
}, {
|
||||||
"id": "cpuTemp",
|
"id": "cpuTemp",
|
||||||
"text": "CPU Temperature",
|
"text": "CPU Temperature",
|
||||||
"description": "CPU temperature display",
|
"description": "CPU temperature display",
|
||||||
"icon": "device_thermostat",
|
"icon": "device_thermostat",
|
||||||
"enabled": DankgopService.dankgopAvailable,
|
"enabled": DgopService.dgopAvailable,
|
||||||
"warning": !DankgopService.dankgopAvailable ? "Requires 'dankgop' tool" : undefined
|
"warning": !DgopService.dgopAvailable ? "Requires 'dgop' tool" : undefined
|
||||||
}, {
|
}, {
|
||||||
"id": "gpuTemp",
|
"id": "gpuTemp",
|
||||||
"text": "GPU Temperature",
|
"text": "GPU Temperature",
|
||||||
"description": "GPU temperature display",
|
"description": "GPU temperature display",
|
||||||
"icon": "auto_awesome_mosaic",
|
"icon": "auto_awesome_mosaic",
|
||||||
"warning": !DankgopService.dankgopAvailable ? "Requires 'dankgop' tool" : "This widget prevents GPU power off states, which can significantly impact battery life on laptops. It is not recommended to use this on laptops with hybrid graphics.",
|
"warning": !DgopService.dgopAvailable ? "Requires 'dgop' tool" : "This widget prevents GPU power off states, which can significantly impact battery life on laptops. It is not recommended to use this on laptops with hybrid graphics.",
|
||||||
"enabled": DankgopService.dankgopAvailable
|
"enabled": DgopService.dgopAvailable
|
||||||
}, {
|
}, {
|
||||||
"id": "systemTray",
|
"id": "systemTray",
|
||||||
"text": "System Tray",
|
"text": "System Tray",
|
||||||
@@ -315,14 +315,14 @@ Item {
|
|||||||
"id": widget,
|
"id": widget,
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"selectedGpuIndex": selectedGpuIndex,
|
"selectedGpuIndex": selectedGpuIndex,
|
||||||
"pciId": DankgopService.availableGpus && DankgopService.availableGpus.length > selectedGpuIndex ? DankgopService.availableGpus[selectedGpuIndex].pciId : ""
|
"pciId": DgopService.availableGpus && DgopService.availableGpus.length > selectedGpuIndex ? DgopService.availableGpus[selectedGpuIndex].pciId : ""
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var newWidget = {
|
var newWidget = {
|
||||||
"id": widget.id,
|
"id": widget.id,
|
||||||
"enabled": widget.enabled,
|
"enabled": widget.enabled,
|
||||||
"selectedGpuIndex": selectedGpuIndex,
|
"selectedGpuIndex": selectedGpuIndex,
|
||||||
"pciId": DankgopService.availableGpus && DankgopService.availableGpus.length > selectedGpuIndex ? DankgopService.availableGpus[selectedGpuIndex].pciId : ""
|
"pciId": DgopService.availableGpus && DgopService.availableGpus.length > selectedGpuIndex ? DgopService.availableGpus[selectedGpuIndex].pciId : ""
|
||||||
}
|
}
|
||||||
if (widget.size !== undefined) newWidget.size = widget.size
|
if (widget.size !== undefined) newWidget.size = widget.size
|
||||||
widgets[widgetIndex] = newWidget
|
widgets[widgetIndex] = newWidget
|
||||||
|
|||||||
@@ -148,22 +148,22 @@ Column {
|
|||||||
currentValue: {
|
currentValue: {
|
||||||
var selectedIndex = modelData.selectedGpuIndex
|
var selectedIndex = modelData.selectedGpuIndex
|
||||||
!== undefined ? modelData.selectedGpuIndex : 0
|
!== undefined ? modelData.selectedGpuIndex : 0
|
||||||
if (DankgopService.availableGpus
|
if (DgopService.availableGpus
|
||||||
&& DankgopService.availableGpus.length > selectedIndex
|
&& DgopService.availableGpus.length > selectedIndex
|
||||||
&& selectedIndex >= 0) {
|
&& selectedIndex >= 0) {
|
||||||
var gpu = DankgopService.availableGpus[selectedIndex]
|
var gpu = DgopService.availableGpus[selectedIndex]
|
||||||
return gpu.driver.toUpperCase()
|
return gpu.driver.toUpperCase()
|
||||||
}
|
}
|
||||||
return DankgopService.availableGpus
|
return DgopService.availableGpus
|
||||||
&& DankgopService.availableGpus.length
|
&& DgopService.availableGpus.length
|
||||||
> 0 ? DankgopService.availableGpus[0].driver.toUpperCase() : ""
|
> 0 ? DgopService.availableGpus[0].driver.toUpperCase() : ""
|
||||||
}
|
}
|
||||||
options: {
|
options: {
|
||||||
var gpuOptions = []
|
var gpuOptions = []
|
||||||
if (DankgopService.availableGpus
|
if (DgopService.availableGpus
|
||||||
&& DankgopService.availableGpus.length > 0) {
|
&& DgopService.availableGpus.length > 0) {
|
||||||
for (var i = 0; i < DankgopService.availableGpus.length; i++) {
|
for (var i = 0; i < DgopService.availableGpus.length; i++) {
|
||||||
var gpu = DankgopService.availableGpus[i]
|
var gpu = DgopService.availableGpus[i]
|
||||||
gpuOptions.push(gpu.driver.toUpperCase())
|
gpuOptions.push(gpu.driver.toUpperCase())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,10 +23,10 @@ Rectangle {
|
|||||||
baseColor.a * Theme.widgetTransparency)
|
baseColor.a * Theme.widgetTransparency)
|
||||||
}
|
}
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
DankgopService.addRef(["cpu"])
|
DgopService.addRef(["cpu"])
|
||||||
}
|
}
|
||||||
Component.onDestruction: {
|
Component.onDestruction: {
|
||||||
DankgopService.removeRef(["cpu"])
|
DgopService.removeRef(["cpu"])
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
@@ -45,7 +45,7 @@ Rectangle {
|
|||||||
Theme.barHeight + Theme.spacingXS,
|
Theme.barHeight + Theme.spacingXS,
|
||||||
width, section, currentScreen)
|
width, section, currentScreen)
|
||||||
}
|
}
|
||||||
DankgopService.setSortBy("cpu")
|
DgopService.setSortBy("cpu")
|
||||||
if (root.toggleProcessList)
|
if (root.toggleProcessList)
|
||||||
root.toggleProcessList()
|
root.toggleProcessList()
|
||||||
}
|
}
|
||||||
@@ -59,10 +59,10 @@ Rectangle {
|
|||||||
name: "memory"
|
name: "memory"
|
||||||
size: Theme.iconSize - 8
|
size: Theme.iconSize - 8
|
||||||
color: {
|
color: {
|
||||||
if (DankgopService.cpuUsage > 80)
|
if (DgopService.cpuUsage > 80)
|
||||||
return Theme.tempDanger
|
return Theme.tempDanger
|
||||||
|
|
||||||
if (DankgopService.cpuUsage > 60)
|
if (DgopService.cpuUsage > 60)
|
||||||
return Theme.tempWarning
|
return Theme.tempWarning
|
||||||
|
|
||||||
return Theme.surfaceText
|
return Theme.surfaceText
|
||||||
@@ -72,12 +72,12 @@ Rectangle {
|
|||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: {
|
text: {
|
||||||
if (DankgopService.cpuUsage === undefined
|
if (DgopService.cpuUsage === undefined
|
||||||
|| DankgopService.cpuUsage === null
|
|| DgopService.cpuUsage === null
|
||||||
|| DankgopService.cpuUsage === 0) {
|
|| DgopService.cpuUsage === 0) {
|
||||||
return "--%"
|
return "--%"
|
||||||
}
|
}
|
||||||
return DankgopService.cpuUsage.toFixed(0) + "%"
|
return DgopService.cpuUsage.toFixed(0) + "%"
|
||||||
}
|
}
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
font.weight: Font.Medium
|
font.weight: Font.Medium
|
||||||
|
|||||||
@@ -23,10 +23,10 @@ Rectangle {
|
|||||||
baseColor.a * Theme.widgetTransparency)
|
baseColor.a * Theme.widgetTransparency)
|
||||||
}
|
}
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
DankgopService.addRef(["cpu"])
|
DgopService.addRef(["cpu"])
|
||||||
}
|
}
|
||||||
Component.onDestruction: {
|
Component.onDestruction: {
|
||||||
DankgopService.removeRef(["cpu"])
|
DgopService.removeRef(["cpu"])
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
@@ -45,7 +45,7 @@ Rectangle {
|
|||||||
Theme.barHeight + Theme.spacingXS,
|
Theme.barHeight + Theme.spacingXS,
|
||||||
width, section, currentScreen)
|
width, section, currentScreen)
|
||||||
}
|
}
|
||||||
DankgopService.setSortBy("cpu")
|
DgopService.setSortBy("cpu")
|
||||||
if (root.toggleProcessList)
|
if (root.toggleProcessList)
|
||||||
root.toggleProcessList()
|
root.toggleProcessList()
|
||||||
}
|
}
|
||||||
@@ -59,10 +59,10 @@ Rectangle {
|
|||||||
name: "memory"
|
name: "memory"
|
||||||
size: Theme.iconSize - 8
|
size: Theme.iconSize - 8
|
||||||
color: {
|
color: {
|
||||||
if (DankgopService.cpuTemperature > 85)
|
if (DgopService.cpuTemperature > 85)
|
||||||
return Theme.tempDanger
|
return Theme.tempDanger
|
||||||
|
|
||||||
if (DankgopService.cpuTemperature > 69)
|
if (DgopService.cpuTemperature > 69)
|
||||||
return Theme.tempWarning
|
return Theme.tempWarning
|
||||||
|
|
||||||
return Theme.surfaceText
|
return Theme.surfaceText
|
||||||
@@ -72,12 +72,12 @@ Rectangle {
|
|||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: {
|
text: {
|
||||||
if (DankgopService.cpuTemperature === undefined
|
if (DgopService.cpuTemperature === undefined
|
||||||
|| DankgopService.cpuTemperature === null
|
|| DgopService.cpuTemperature === null
|
||||||
|| DankgopService.cpuTemperature < 0) {
|
|| DgopService.cpuTemperature < 0) {
|
||||||
return "--°"
|
return "--°"
|
||||||
}
|
}
|
||||||
return Math.round(DankgopService.cpuTemperature) + "°"
|
return Math.round(DgopService.cpuTemperature) + "°"
|
||||||
}
|
}
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
font.weight: Font.Medium
|
font.weight: Font.Medium
|
||||||
|
|||||||
@@ -37,12 +37,12 @@ Rectangle {
|
|||||||
baseColor.a * Theme.widgetTransparency)
|
baseColor.a * Theme.widgetTransparency)
|
||||||
}
|
}
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
DankgopService.addRef(["gpu"])
|
DgopService.addRef(["gpu"])
|
||||||
console.log("GpuTemperature widget - pciId:", widgetData ? widgetData.pciId : "no widgetData", "selectedGpuIndex:", widgetData ? widgetData.selectedGpuIndex : "no widgetData")
|
console.log("GpuTemperature widget - pciId:", widgetData ? widgetData.pciId : "no widgetData", "selectedGpuIndex:", widgetData ? widgetData.selectedGpuIndex : "no widgetData")
|
||||||
// Add this widget's PCI ID to the service
|
// Add this widget's PCI ID to the service
|
||||||
if (widgetData && widgetData.pciId) {
|
if (widgetData && widgetData.pciId) {
|
||||||
console.log("Adding GPU PCI ID to service:", widgetData.pciId)
|
console.log("Adding GPU PCI ID to service:", widgetData.pciId)
|
||||||
DankgopService.addGpuPciId(widgetData.pciId)
|
DgopService.addGpuPciId(widgetData.pciId)
|
||||||
} else {
|
} else {
|
||||||
console.log("No PCI ID in widget data, starting auto-detection")
|
console.log("No PCI ID in widget data, starting auto-detection")
|
||||||
// No PCI ID saved, auto-detect and save the first GPU
|
// No PCI ID saved, auto-detect and save the first GPU
|
||||||
@@ -50,20 +50,20 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Component.onDestruction: {
|
Component.onDestruction: {
|
||||||
DankgopService.removeRef(["gpu"])
|
DgopService.removeRef(["gpu"])
|
||||||
// Remove this widget's PCI ID from the service
|
// Remove this widget's PCI ID from the service
|
||||||
if (widgetData && widgetData.pciId) {
|
if (widgetData && widgetData.pciId) {
|
||||||
DankgopService.removeGpuPciId(widgetData.pciId)
|
DgopService.removeGpuPciId(widgetData.pciId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
property real displayTemp: {
|
property real displayTemp: {
|
||||||
if (!DankgopService.availableGpus
|
if (!DgopService.availableGpus
|
||||||
|| DankgopService.availableGpus.length === 0)
|
|| DgopService.availableGpus.length === 0)
|
||||||
return 0
|
return 0
|
||||||
if (selectedGpuIndex >= 0
|
if (selectedGpuIndex >= 0
|
||||||
&& selectedGpuIndex < DankgopService.availableGpus.length) {
|
&& selectedGpuIndex < DgopService.availableGpus.length) {
|
||||||
return DankgopService.availableGpus[selectedGpuIndex].temperature || 0
|
return DgopService.availableGpus[selectedGpuIndex].temperature || 0
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@@ -84,7 +84,7 @@ Rectangle {
|
|||||||
Theme.barHeight + Theme.spacingXS,
|
Theme.barHeight + Theme.spacingXS,
|
||||||
width, section, currentScreen)
|
width, section, currentScreen)
|
||||||
}
|
}
|
||||||
DankgopService.setSortBy("cpu")
|
DgopService.setSortBy("cpu")
|
||||||
if (root.toggleProcessList)
|
if (root.toggleProcessList)
|
||||||
root.toggleProcessList()
|
root.toggleProcessList()
|
||||||
}
|
}
|
||||||
@@ -136,12 +136,12 @@ Rectangle {
|
|||||||
interval: 100
|
interval: 100
|
||||||
running: false
|
running: false
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
if (DankgopService.availableGpus && DankgopService.availableGpus.length > 0) {
|
if (DgopService.availableGpus && DgopService.availableGpus.length > 0) {
|
||||||
const firstGpu = DankgopService.availableGpus[0]
|
const firstGpu = DgopService.availableGpus[0]
|
||||||
if (firstGpu && firstGpu.pciId) {
|
if (firstGpu && firstGpu.pciId) {
|
||||||
// Save the first GPU's PCI ID to this widget's settings
|
// Save the first GPU's PCI ID to this widget's settings
|
||||||
updateWidgetPciId(firstGpu.pciId)
|
updateWidgetPciId(firstGpu.pciId)
|
||||||
DankgopService.addGpuPciId(firstGpu.pciId)
|
DgopService.addGpuPciId(firstGpu.pciId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,10 +23,10 @@ Rectangle {
|
|||||||
baseColor.a * Theme.widgetTransparency)
|
baseColor.a * Theme.widgetTransparency)
|
||||||
}
|
}
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
DankgopService.addRef(["memory"])
|
DgopService.addRef(["memory"])
|
||||||
}
|
}
|
||||||
Component.onDestruction: {
|
Component.onDestruction: {
|
||||||
DankgopService.removeRef(["memory"])
|
DgopService.removeRef(["memory"])
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
@@ -45,7 +45,7 @@ Rectangle {
|
|||||||
Theme.barHeight + Theme.spacingXS,
|
Theme.barHeight + Theme.spacingXS,
|
||||||
width, section, currentScreen)
|
width, section, currentScreen)
|
||||||
}
|
}
|
||||||
DankgopService.setSortBy("memory")
|
DgopService.setSortBy("memory")
|
||||||
if (root.toggleProcessList)
|
if (root.toggleProcessList)
|
||||||
root.toggleProcessList()
|
root.toggleProcessList()
|
||||||
}
|
}
|
||||||
@@ -59,10 +59,10 @@ Rectangle {
|
|||||||
name: "developer_board"
|
name: "developer_board"
|
||||||
size: Theme.iconSize - 8
|
size: Theme.iconSize - 8
|
||||||
color: {
|
color: {
|
||||||
if (DankgopService.memoryUsage > 90)
|
if (DgopService.memoryUsage > 90)
|
||||||
return Theme.tempDanger
|
return Theme.tempDanger
|
||||||
|
|
||||||
if (DankgopService.memoryUsage > 75)
|
if (DgopService.memoryUsage > 75)
|
||||||
return Theme.tempWarning
|
return Theme.tempWarning
|
||||||
|
|
||||||
return Theme.surfaceText
|
return Theme.surfaceText
|
||||||
@@ -72,12 +72,12 @@ Rectangle {
|
|||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: {
|
text: {
|
||||||
if (DankgopService.memoryUsage === undefined
|
if (DgopService.memoryUsage === undefined
|
||||||
|| DankgopService.memoryUsage === null
|
|| DgopService.memoryUsage === null
|
||||||
|| DankgopService.memoryUsage === 0) {
|
|| DgopService.memoryUsage === 0) {
|
||||||
return "--%"
|
return "--%"
|
||||||
}
|
}
|
||||||
return DankgopService.memoryUsage.toFixed(0) + "%"
|
return DgopService.memoryUsage.toFixed(0) + "%"
|
||||||
}
|
}
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
font.weight: Font.Medium
|
font.weight: Font.Medium
|
||||||
|
|||||||
@@ -60,9 +60,9 @@ PanelWindow {
|
|||||||
return widgetId === "gpuTemp" && widgetEnabled
|
return widgetId === "gpuTemp" && widgetEnabled
|
||||||
})
|
})
|
||||||
|
|
||||||
DankgopService.gpuTempEnabled = hasGpuTempWidget || SessionData.nvidiaGpuTempEnabled || SessionData.nonNvidiaGpuTempEnabled
|
DgopService.gpuTempEnabled = hasGpuTempWidget || SessionData.nvidiaGpuTempEnabled || SessionData.nonNvidiaGpuTempEnabled
|
||||||
DankgopService.nvidiaGpuTempEnabled = hasGpuTempWidget || SessionData.nvidiaGpuTempEnabled
|
DgopService.nvidiaGpuTempEnabled = hasGpuTempWidget || SessionData.nvidiaGpuTempEnabled
|
||||||
DankgopService.nonNvidiaGpuTempEnabled = hasGpuTempWidget || SessionData.nonNvidiaGpuTempEnabled
|
DgopService.nonNvidiaGpuTempEnabled = hasGpuTempWidget || SessionData.nonNvidiaGpuTempEnabled
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
@@ -279,13 +279,13 @@ PanelWindow {
|
|||||||
case "clipboard":
|
case "clipboard":
|
||||||
return true
|
return true
|
||||||
case "cpuUsage":
|
case "cpuUsage":
|
||||||
return DankgopService.dankgopAvailable
|
return DgopService.dgopAvailable
|
||||||
case "memUsage":
|
case "memUsage":
|
||||||
return DankgopService.dankgopAvailable
|
return DgopService.dgopAvailable
|
||||||
case "cpuTemp":
|
case "cpuTemp":
|
||||||
return DankgopService.dankgopAvailable
|
return DgopService.dgopAvailable
|
||||||
case "gpuTemp":
|
case "gpuTemp":
|
||||||
return DankgopService.dankgopAvailable
|
return DgopService.dgopAvailable
|
||||||
case "notificationButton":
|
case "notificationButton":
|
||||||
return true
|
return true
|
||||||
case "battery":
|
case "battery":
|
||||||
|
|||||||
@@ -157,15 +157,15 @@ rm /tmp/FiraCode.zip && fc-cache -f
|
|||||||
**Enhanced Functionality:**
|
**Enhanced Functionality:**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Install dankgop on any distro (requires go 1.23+):
|
# Install dgop on any distro (requires go 1.23+):
|
||||||
git clone https://github.com/AvengeMedia/dankgop.git && cd dankgop
|
git clone https://github.com/AvengeMedia/dgop.git && cd dgop
|
||||||
make && sudo make install
|
make && sudo make install
|
||||||
```
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Arch Linux
|
# Arch Linux
|
||||||
pacman -S cava wl-clipboard cliphist ddcutil brightnessctl
|
pacman -S cava wl-clipboard cliphist ddcutil brightnessctl
|
||||||
paru -S matugen dankgop-git
|
paru -S matugen dgop-git
|
||||||
|
|
||||||
# Fedora
|
# Fedora
|
||||||
sudo dnf install cava wl-clipboard ddcutil brightnessctl
|
sudo dnf install cava wl-clipboard ddcutil brightnessctl
|
||||||
@@ -175,7 +175,7 @@ sudo dnf copr enable heus-sueh/packages && sudo dnf install matugen
|
|||||||
|
|
||||||
**What you get:**
|
**What you get:**
|
||||||
|
|
||||||
- `dankgop-git`: Ability to have system resource widgets, process list modal, and temperature monitoring.
|
- `dgop-git`: Ability to have system resource widgets, process list modal, and temperature monitoring.
|
||||||
- `matugen`: Wallpaper-based dynamic theming
|
- `matugen`: Wallpaper-based dynamic theming
|
||||||
- `ddcutil`: External monitor brightness control
|
- `ddcutil`: External monitor brightness control
|
||||||
- `brightnessctl`: Laptop display brightness
|
- `brightnessctl`: Laptop display brightness
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ Singleton {
|
|||||||
property int refCount: 0
|
property int refCount: 0
|
||||||
property int updateInterval: refCount > 0 ? 3000 : 30000
|
property int updateInterval: refCount > 0 ? 3000 : 30000
|
||||||
property bool isUpdating: false
|
property bool isUpdating: false
|
||||||
property bool dankgopAvailable: false
|
property bool dgopAvailable: false
|
||||||
|
|
||||||
property var moduleRefCounts: ({})
|
property var moduleRefCounts: ({})
|
||||||
property var enabledModules: []
|
property var enabledModules: []
|
||||||
@@ -205,22 +205,22 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function updateAllStats() {
|
function updateAllStats() {
|
||||||
if (dankgopAvailable && refCount > 0 && enabledModules.length > 0) {
|
if (dgopAvailable && refCount > 0 && enabledModules.length > 0) {
|
||||||
isUpdating = true
|
isUpdating = true
|
||||||
dankgopProcess.running = true
|
dgopProcess.running = true
|
||||||
} else {
|
} else {
|
||||||
isUpdating = false
|
isUpdating = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function initializeGpuMetadata() {
|
function initializeGpuMetadata() {
|
||||||
if (!dankgopAvailable) return
|
if (!dgopAvailable) return
|
||||||
// Load GPU metadata once at startup for basic info
|
// Load GPU metadata once at startup for basic info
|
||||||
gpuInitProcess.running = true
|
gpuInitProcess.running = true
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildDankgopCommand() {
|
function buildDgopCommand() {
|
||||||
const cmd = ["dankgop", "meta", "--json"]
|
const cmd = ["dgop", "meta", "--json"]
|
||||||
|
|
||||||
if (enabledModules.length === 0) {
|
if (enabledModules.length === 0) {
|
||||||
// Don't run if no modules are needed
|
// Don't run if no modules are needed
|
||||||
@@ -281,7 +281,7 @@ Singleton {
|
|||||||
const cpu = data.cpu
|
const cpu = data.cpu
|
||||||
cpuSampleCount++
|
cpuSampleCount++
|
||||||
|
|
||||||
// Use dankgop CPU numbers directly without modification
|
// Use dgop CPU numbers directly without modification
|
||||||
cpuUsage = cpu.usage || 0
|
cpuUsage = cpu.usage || 0
|
||||||
cpuFrequency = cpu.frequency || 0
|
cpuFrequency = cpu.frequency || 0
|
||||||
cpuTemperature = cpu.temperature || 0
|
cpuTemperature = cpu.temperature || 0
|
||||||
@@ -516,22 +516,22 @@ Singleton {
|
|||||||
Timer {
|
Timer {
|
||||||
id: updateTimer
|
id: updateTimer
|
||||||
interval: root.updateInterval
|
interval: root.updateInterval
|
||||||
running: root.dankgopAvailable && root.refCount > 0 && root.enabledModules.length > 0
|
running: root.dgopAvailable && root.refCount > 0 && root.enabledModules.length > 0
|
||||||
repeat: true
|
repeat: true
|
||||||
triggeredOnStart: true
|
triggeredOnStart: true
|
||||||
onTriggered: root.updateAllStats()
|
onTriggered: root.updateAllStats()
|
||||||
}
|
}
|
||||||
|
|
||||||
Process {
|
Process {
|
||||||
id: dankgopProcess
|
id: dgopProcess
|
||||||
command: root.buildDankgopCommand()
|
command: root.buildDgopCommand()
|
||||||
running: false
|
running: false
|
||||||
onCommandChanged: {
|
onCommandChanged: {
|
||||||
//console.log("DankgopService command:", JSON.stringify(command))
|
//console.log("DgopService command:", JSON.stringify(command))
|
||||||
}
|
}
|
||||||
onExited: exitCode => {
|
onExited: exitCode => {
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
console.warn("Dankgop process failed with exit code:", exitCode)
|
console.warn("Dgop process failed with exit code:", exitCode)
|
||||||
isUpdating = false
|
isUpdating = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -542,7 +542,7 @@ Singleton {
|
|||||||
const data = JSON.parse(text.trim())
|
const data = JSON.parse(text.trim())
|
||||||
parseData(data)
|
parseData(data)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn("Failed to parse dankgop JSON:", e)
|
console.warn("Failed to parse dgop JSON:", e)
|
||||||
console.warn("Raw text was:", text.substring(0, 200))
|
console.warn("Raw text was:", text.substring(0, 200))
|
||||||
isUpdating = false
|
isUpdating = false
|
||||||
}
|
}
|
||||||
@@ -553,7 +553,7 @@ Singleton {
|
|||||||
|
|
||||||
Process {
|
Process {
|
||||||
id: gpuInitProcess
|
id: gpuInitProcess
|
||||||
command: ["dankgop", "gpu", "--json"]
|
command: ["dgop", "gpu", "--json"]
|
||||||
running: false
|
running: false
|
||||||
onExited: exitCode => {
|
onExited: exitCode => {
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
@@ -575,12 +575,12 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Process {
|
Process {
|
||||||
id: dankgopCheckProcess
|
id: dgopCheckProcess
|
||||||
command: ["which", "dankgop"]
|
command: ["which", "dgop"]
|
||||||
running: false
|
running: false
|
||||||
onExited: exitCode => {
|
onExited: exitCode => {
|
||||||
dankgopAvailable = (exitCode === 0)
|
dgopAvailable = (exitCode === 0)
|
||||||
if (dankgopAvailable) {
|
if (dgopAvailable) {
|
||||||
initializeGpuMetadata()
|
initializeGpuMetadata()
|
||||||
// Load persisted GPU PCI IDs from session state
|
// Load persisted GPU PCI IDs from session state
|
||||||
if (SessionData.enabledGpuPciIds && SessionData.enabledGpuPciIds.length > 0) {
|
if (SessionData.enabledGpuPciIds && SessionData.enabledGpuPciIds.length > 0) {
|
||||||
@@ -593,12 +593,12 @@ Singleton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.warn("dankgop is not installed or not in PATH")
|
console.warn("dgop is not installed or not in PATH")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
dankgopCheckProcess.running = true
|
dgopCheckProcess.running = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user