1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-06 05:25:41 -05:00

dgop was rebranded

This commit is contained in:
bbedward
2025-08-10 22:21:54 -04:00
parent 5b259db341
commit 9bc5de8a8a
17 changed files with 259 additions and 259 deletions

View File

@@ -18,8 +18,8 @@ DankModal {
property var tabNames: ["Processes", "Performance", "System"]
function show() {
if (!DankgopService.dankgopAvailable) {
console.warn("ProcessListModal: dankgop is not available")
if (!DgopService.dgopAvailable) {
console.warn("ProcessListModal: dgop is not available")
return
}
processListModal.visible = true
@@ -33,8 +33,8 @@ DankModal {
}
function toggle() {
if (!DankgopService.dankgopAvailable) {
console.warn("ProcessListModal: dankgop is not available")
if (!DgopService.dgopAvailable) {
console.warn("ProcessListModal: dgop is not available")
return
}
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 {
anchors.centerIn: parent
width: 400
@@ -106,7 +106,7 @@ DankModal {
color: Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.1)
border.color: Theme.error
border.width: 2
visible: !DankgopService.dankgopAvailable
visible: !DgopService.dgopAvailable
Column {
anchors.centerIn: parent
@@ -128,7 +128,7 @@ DankModal {
}
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
color: Theme.surfaceText
anchors.horizontalCenter: parent.horizontalCenter
@@ -142,7 +142,7 @@ DankModal {
anchors.fill: parent
anchors.margins: Theme.spacingL
spacing: Theme.spacingL
visible: DankgopService.dankgopAvailable
visible: DgopService.dgopAvailable
RowLayout {
Layout.fillWidth: true

View File

@@ -13,7 +13,7 @@ Rectangle {
border.width: 1
Ref {
service: DankgopService
service: DgopService
}
Column {
@@ -36,7 +36,7 @@ Rectangle {
spacing: Theme.spacingXS
StyledText {
text: DankgopService.hostname
text: DgopService.hostname
font.pixelSize: Theme.fontSizeLarge
font.weight: Font.Medium
color: Theme.surfaceText
@@ -45,7 +45,7 @@ Rectangle {
}
StyledText {
text: DankgopService.distribution + " • " + DankgopService.architecture
text: DgopService.distribution + " • " + DgopService.architecture
font.pixelSize: Theme.fontSizeSmall
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
Theme.surfaceText.b, 0.7)
@@ -74,7 +74,7 @@ Rectangle {
}
StyledText {
text: "Load: " + DankgopService.loadAverage
text: "Load: " + DgopService.loadAverage
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceText
width: parent.width
@@ -82,8 +82,8 @@ Rectangle {
}
StyledText {
text: DankgopService.processCount + " proc, "
+ DankgopService.threadCount + " threads"
text: DgopService.processCount + " proc, "
+ DgopService.threadCount + " threads"
font.pixelSize: Theme.fontSizeSmall
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
Theme.surfaceText.b, 0.8)

View File

@@ -28,10 +28,10 @@ Column {
anchors.fill: parent
spacing: Theme.spacingM
Component.onCompleted: {
DankgopService.addRef(["cpu", "memory", "network", "disk"])
DgopService.addRef(["cpu", "memory", "network", "disk"])
}
Component.onDestruction: {
DankgopService.removeRef(["cpu", "memory", "network", "disk"])
DgopService.removeRef(["cpu", "memory", "network", "disk"])
}
Rectangle {
@@ -71,7 +71,7 @@ Column {
anchors.verticalCenter: parent.verticalCenter
StyledText {
text: DankgopService.cpuUsage.toFixed(1) + "%"
text: DgopService.cpuUsage.toFixed(1) + "%"
font.pixelSize: Theme.fontSizeSmall
font.weight: Font.Bold
color: Theme.primary
@@ -85,7 +85,7 @@ Column {
}
StyledText {
text: DankgopService.cpuCores + " cores"
text: DgopService.cpuCores + " cores"
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
anchors.verticalCenter: parent.verticalCenter
@@ -104,7 +104,7 @@ Column {
spacing: 6
Repeater {
model: DankgopService.perCoreCpuUsage
model: DgopService.perCoreCpuUsage
Row {
width: parent.width
@@ -193,9 +193,9 @@ Column {
}
StyledText {
text: DankgopService.formatSystemMemory(
DankgopService.usedMemoryKB) + " / " + DankgopService.formatSystemMemory(
DankgopService.totalMemoryKB)
text: DgopService.formatSystemMemory(
DgopService.usedMemoryKB) + " / " + DgopService.formatSystemMemory(
DgopService.totalMemoryKB)
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
}
@@ -218,15 +218,15 @@ Column {
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Rectangle {
width: DankgopService.totalMemoryKB
> 0 ? parent.width * (DankgopService.usedMemoryKB
/ DankgopService.totalMemoryKB) : 0
width: DgopService.totalMemoryKB
> 0 ? parent.width * (DgopService.usedMemoryKB
/ DgopService.totalMemoryKB) : 0
height: parent.height
radius: parent.radius
color: {
const usage = DankgopService.totalMemoryKB
> 0 ? (DankgopService.usedMemoryKB
/ DankgopService.totalMemoryKB) : 0
const usage = DgopService.totalMemoryKB
> 0 ? (DgopService.usedMemoryKB
/ DgopService.totalMemoryKB) : 0
if (usage > 0.9)
return Theme.error
@@ -245,9 +245,9 @@ Column {
}
StyledText {
text: DankgopService.totalMemoryKB
> 0 ? ((DankgopService.usedMemoryKB
/ DankgopService.totalMemoryKB) * 100).toFixed(
text: DgopService.totalMemoryKB
> 0 ? ((DgopService.usedMemoryKB
/ DgopService.totalMemoryKB) * 100).toFixed(
1) + "% used" : "No data"
font.pixelSize: Theme.fontSizeSmall
font.weight: Font.Bold
@@ -272,11 +272,11 @@ Column {
}
StyledText {
text: DankgopService.totalSwapKB
> 0 ? DankgopService.formatSystemMemory(
DankgopService.usedSwapKB) + " / "
+ DankgopService.formatSystemMemory(
DankgopService.totalSwapKB) : "No swap configured"
text: DgopService.totalSwapKB
> 0 ? DgopService.formatSystemMemory(
DgopService.usedSwapKB) + " / "
+ DgopService.formatSystemMemory(
DgopService.totalSwapKB) : "No swap configured"
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
}
@@ -299,17 +299,17 @@ Column {
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
Rectangle {
width: DankgopService.totalSwapKB
> 0 ? parent.width * (DankgopService.usedSwapKB
/ DankgopService.totalSwapKB) : 0
width: DgopService.totalSwapKB
> 0 ? parent.width * (DgopService.usedSwapKB
/ DgopService.totalSwapKB) : 0
height: parent.height
radius: parent.radius
color: {
if (!DankgopService.totalSwapKB)
if (!DgopService.totalSwapKB)
return Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
Theme.surfaceText.b, 0.3)
const usage = DankgopService.usedSwapKB / DankgopService.totalSwapKB
const usage = DgopService.usedSwapKB / DgopService.totalSwapKB
if (usage > 0.9)
return Theme.error
@@ -328,9 +328,9 @@ Column {
}
StyledText {
text: DankgopService.totalSwapKB
> 0 ? ((DankgopService.usedSwapKB
/ DankgopService.totalSwapKB) * 100).toFixed(
text: DgopService.totalSwapKB
> 0 ? ((DgopService.usedSwapKB
/ DgopService.totalSwapKB) * 100).toFixed(
1) + "% used" : "Not available"
font.pixelSize: Theme.fontSizeSmall
font.weight: Font.Bold
@@ -381,9 +381,9 @@ Column {
}
StyledText {
text: DankgopService.networkRxRate
text: DgopService.networkRxRate
> 0 ? formatNetworkSpeed(
DankgopService.networkRxRate) : "0 B/s"
DgopService.networkRxRate) : "0 B/s"
font.pixelSize: Theme.fontSizeSmall
font.weight: Font.Bold
color: Theme.surfaceText
@@ -400,9 +400,9 @@ Column {
}
StyledText {
text: DankgopService.networkTxRate
text: DgopService.networkTxRate
> 0 ? formatNetworkSpeed(
DankgopService.networkTxRate) : "0 B/s"
DgopService.networkTxRate) : "0 B/s"
font.pixelSize: Theme.fontSizeSmall
font.weight: Font.Bold
color: Theme.surfaceText
@@ -448,7 +448,7 @@ Column {
}
StyledText {
text: formatDiskSpeed(DankgopService.diskReadRate)
text: formatDiskSpeed(DgopService.diskReadRate)
font.pixelSize: Theme.fontSizeSmall
font.weight: Font.Bold
color: Theme.surfaceText
@@ -465,7 +465,7 @@ Column {
}
StyledText {
text: formatDiskSpeed(DankgopService.diskWriteRate)
text: formatDiskSpeed(DgopService.diskWriteRate)
font.pixelSize: Theme.fontSizeSmall
font.weight: Font.Bold
color: Theme.surfaceText

View File

@@ -59,7 +59,7 @@ Rectangle {
DankIcon {
id: processIcon
name: DankgopService.getProcessIcon(process ? process.command : "")
name: DgopService.getProcessIcon(process ? process.command : "")
size: Theme.iconSize - 4
color: {
if (process && process.cpu > 80)
@@ -110,7 +110,7 @@ Rectangle {
anchors.verticalCenter: parent.verticalCenter
StyledText {
text: DankgopService.formatCpuUsage(process ? process.cpu : 0)
text: DgopService.formatCpuUsage(process ? process.cpu : 0)
font.pixelSize: Theme.fontSizeSmall
font.family: SettingsData.monoFontFamily
font.weight: Font.Bold
@@ -149,7 +149,7 @@ Rectangle {
anchors.verticalCenter: parent.verticalCenter
StyledText {
text: DankgopService.formatMemoryUsage(
text: DgopService.formatMemoryUsage(
process ? process.memoryKB : 0)
font.pixelSize: Theme.fontSizeSmall
font.family: SettingsData.monoFontFamily

View File

@@ -57,7 +57,7 @@ PanelWindow {
color: "transparent"
Ref {
service: DankgopService
service: DgopService
}
anchors {

View File

@@ -10,10 +10,10 @@ Column {
property var contextMenu: null
Component.onCompleted: {
DankgopService.addRef(["processes"])
DgopService.addRef(["processes"])
}
Component.onDestruction: {
DankgopService.removeRef(["processes"])
DgopService.removeRef(["processes"])
}
Item {
@@ -39,9 +39,9 @@ Column {
text: "Process"
font.pixelSize: Theme.fontSizeSmall
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
opacity: DankgopService.sortBy === "name" ? 1 : 0.7
opacity: DgopService.sortBy === "name" ? 1 : 0.7
anchors.centerIn: parent
}
@@ -52,7 +52,7 @@ Column {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
DankgopService.setSortBy("name")
DgopService.setSortBy("name")
}
}
@@ -79,9 +79,9 @@ Column {
text: "CPU"
font.pixelSize: Theme.fontSizeSmall
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
opacity: DankgopService.sortBy === "cpu" ? 1 : 0.7
opacity: DgopService.sortBy === "cpu" ? 1 : 0.7
anchors.centerIn: parent
}
@@ -92,7 +92,7 @@ Column {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
DankgopService.setSortBy("cpu")
DgopService.setSortBy("cpu")
}
}
@@ -119,9 +119,9 @@ Column {
text: "RAM"
font.pixelSize: Theme.fontSizeSmall
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
opacity: DankgopService.sortBy === "memory" ? 1 : 0.7
opacity: DgopService.sortBy === "memory" ? 1 : 0.7
anchors.centerIn: parent
}
@@ -132,7 +132,7 @@ Column {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
DankgopService.setSortBy("memory")
DgopService.setSortBy("memory")
}
}
@@ -159,9 +159,9 @@ Column {
text: "PID"
font.pixelSize: Theme.fontSizeSmall
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
opacity: DankgopService.sortBy === "pid" ? 1 : 0.7
opacity: DgopService.sortBy === "pid" ? 1 : 0.7
horizontalAlignment: Text.AlignHCenter
anchors.centerIn: parent
}
@@ -173,7 +173,7 @@ Column {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
DankgopService.setSortBy("pid")
DgopService.setSortBy("pid")
}
}
@@ -197,7 +197,7 @@ Column {
anchors.verticalCenter: parent.verticalCenter
StyledText {
text: DankgopService.sortDescending ? "↓" : "↑"
text: DgopService.sortDescending ? "↓" : "↑"
font.pixelSize: Theme.fontSizeMedium
color: Theme.surfaceText
anchors.centerIn: parent
@@ -210,7 +210,7 @@ Column {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
// ! TODO - we lost this with dankgop
// ! TODO - we lost this with dgop
}
}
@@ -231,7 +231,7 @@ Column {
height: parent.height - columnHeaders.height
clip: true
spacing: 4
model: DankgopService.processes
model: DgopService.processes
delegate: ProcessListItem {
process: modelData

View File

@@ -8,10 +8,10 @@ Row {
width: parent.width
spacing: Theme.spacingM
Component.onCompleted: {
DankgopService.addRef(["cpu", "memory", "system"]);
DgopService.addRef(["cpu", "memory", "system"]);
}
Component.onDestruction: {
DankgopService.removeRef(["cpu", "memory", "system"]);
DgopService.removeRef(["cpu", "memory", "system"]);
}
Rectangle {
@@ -19,15 +19,15 @@ Row {
height: 80
radius: Theme.cornerRadius
color: {
if (DankgopService.sortBy === "cpu")
if (DgopService.sortBy === "cpu")
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.16);
else if (cpuCardMouseArea.containsMouse)
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12);
else
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.width: DankgopService.sortBy === "cpu" ? 2 : 1
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: DgopService.sortBy === "cpu" ? 2 : 1
MouseArea {
id: cpuCardMouseArea
@@ -35,7 +35,7 @@ Row {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: DankgopService.setSortBy("cpu")
onClicked: DgopService.setSortBy("cpu")
}
Column {
@@ -48,8 +48,8 @@ Row {
text: "CPU"
font.pixelSize: Theme.fontSizeSmall
font.weight: Font.Medium
color: DankgopService.sortBy === "cpu" ? Theme.primary : Theme.secondary
opacity: DankgopService.sortBy === "cpu" ? 1 : 0.8
color: DgopService.sortBy === "cpu" ? Theme.primary : Theme.secondary
opacity: DgopService.sortBy === "cpu" ? 1 : 0.8
}
Row {
@@ -57,9 +57,9 @@ Row {
StyledText {
text: {
if (DankgopService.cpuUsage === undefined || DankgopService.cpuUsage === null)
if (DgopService.cpuUsage === undefined || DgopService.cpuUsage === null)
return "--%"
return DankgopService.cpuUsage.toFixed(1) + "%"
return DgopService.cpuUsage.toFixed(1) + "%"
}
font.pixelSize: Theme.fontSizeLarge
font.family: SettingsData.monoFontFamily
@@ -77,19 +77,19 @@ Row {
StyledText {
text: {
if (DankgopService.cpuTemperature === undefined || DankgopService.cpuTemperature === null || DankgopService.cpuTemperature <= 0)
if (DgopService.cpuTemperature === undefined || DgopService.cpuTemperature === null || DgopService.cpuTemperature <= 0)
return "--°";
return Math.round(DankgopService.cpuTemperature) + "°";
return Math.round(DgopService.cpuTemperature) + "°";
}
font.pixelSize: Theme.fontSizeMedium
font.family: SettingsData.monoFontFamily
font.weight: Font.Medium
color: {
if (DankgopService.cpuTemperature > 80)
if (DgopService.cpuTemperature > 80)
return Theme.error;
if (DankgopService.cpuTemperature > 60)
if (DgopService.cpuTemperature > 60)
return Theme.warning;
return Theme.surfaceText;
@@ -100,7 +100,7 @@ Row {
}
StyledText {
text: DankgopService.cpuCores + " cores"
text: DgopService.cpuCores + " cores"
font.pixelSize: Theme.fontSizeSmall
font.family: SettingsData.monoFontFamily
color: Theme.surfaceText
@@ -130,15 +130,15 @@ Row {
height: 80
radius: Theme.cornerRadius
color: {
if (DankgopService.sortBy === "memory")
if (DgopService.sortBy === "memory")
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.16);
else if (memoryCardMouseArea.containsMouse)
return Qt.rgba(Theme.secondary.r, Theme.secondary.g, Theme.secondary.b, 0.12);
else
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.width: DankgopService.sortBy === "memory" ? 2 : 1
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: DgopService.sortBy === "memory" ? 2 : 1
MouseArea {
id: memoryCardMouseArea
@@ -146,7 +146,7 @@ Row {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: DankgopService.setSortBy("memory")
onClicked: DgopService.setSortBy("memory")
}
Column {
@@ -159,15 +159,15 @@ Row {
text: "Memory"
font.pixelSize: Theme.fontSizeSmall
font.weight: Font.Medium
color: DankgopService.sortBy === "memory" ? Theme.primary : Theme.secondary
opacity: DankgopService.sortBy === "memory" ? 1 : 0.8
color: DgopService.sortBy === "memory" ? Theme.primary : Theme.secondary
opacity: DgopService.sortBy === "memory" ? 1 : 0.8
}
Row {
spacing: Theme.spacingS
StyledText {
text: DankgopService.formatSystemMemory(DankgopService.usedMemoryKB)
text: DgopService.formatSystemMemory(DgopService.usedMemoryKB)
font.pixelSize: Theme.fontSizeLarge
font.family: SettingsData.monoFontFamily
font.weight: Font.Bold
@@ -180,27 +180,27 @@ Row {
height: 20
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.3)
anchors.verticalCenter: parent.verticalCenter
visible: DankgopService.totalSwapKB > 0
visible: DgopService.totalSwapKB > 0
}
StyledText {
text: DankgopService.totalSwapKB > 0 ? DankgopService.formatSystemMemory(DankgopService.usedSwapKB) : ""
text: DgopService.totalSwapKB > 0 ? DgopService.formatSystemMemory(DgopService.usedSwapKB) : ""
font.pixelSize: Theme.fontSizeMedium
font.family: SettingsData.monoFontFamily
font.weight: Font.Medium
color: DankgopService.usedSwapKB > 0 ? Theme.warning : Theme.surfaceText
color: DgopService.usedSwapKB > 0 ? Theme.warning : Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
visible: DankgopService.totalSwapKB > 0
visible: DgopService.totalSwapKB > 0
}
}
StyledText {
text: {
if (DankgopService.totalSwapKB > 0)
return "of " + DankgopService.formatSystemMemory(DankgopService.totalMemoryKB) + " + swap";
if (DgopService.totalSwapKB > 0)
return "of " + DgopService.formatSystemMemory(DgopService.totalMemoryKB) + " + swap";
return "of " + DankgopService.formatSystemMemory(DankgopService.totalMemoryKB);
return "of " + DgopService.formatSystemMemory(DgopService.totalMemoryKB);
}
font.pixelSize: Theme.fontSizeSmall
font.family: SettingsData.monoFontFamily
@@ -231,40 +231,40 @@ Row {
height: 80
radius: Theme.cornerRadius
color: {
if (!DankgopService.availableGpus || DankgopService.availableGpus.length === 0) {
if (gpuCardMouseArea.containsMouse && DankgopService.availableGpus.length > 1)
if (!DgopService.availableGpus || DgopService.availableGpus.length === 0) {
if (gpuCardMouseArea.containsMouse && DgopService.availableGpus.length > 1)
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.16);
else
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();
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);
else
return Qt.rgba(Theme.success.r, Theme.success.g, Theme.success.b, 0.12);
} 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);
else
return Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.12);
} 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);
else
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);
else
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.08);
}
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);
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();
if (vendor.includes("nvidia"))
return Qt.rgba(Theme.success.r, Theme.success.g, Theme.success.b, 0.3);
@@ -282,11 +282,11 @@ Row {
anchors.fill: parent
hoverEnabled: true
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) => {
if (mouse.button === Qt.LeftButton) {
if (DankgopService.availableGpus.length > 1) {
var nextIndex = (SessionData.selectedGpuIndex + 1) % DankgopService.availableGpus.length;
if (DgopService.availableGpus.length > 1) {
var nextIndex = (SessionData.selectedGpuIndex + 1) % DgopService.availableGpus.length;
SessionData.setSelectedGpuIndex(nextIndex);
}
} else if (mouse.button === Qt.RightButton) {
@@ -311,10 +311,10 @@ Row {
StyledText {
text: {
if (!DankgopService.availableGpus || DankgopService.availableGpus.length === 0)
if (!DgopService.availableGpus || DgopService.availableGpus.length === 0)
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
var tempEnabled = SessionData.enabledGpuPciIds && SessionData.enabledGpuPciIds.indexOf(gpu.pciId) !== -1;
var temp = gpu.temperature;
@@ -328,10 +328,10 @@ Row {
font.family: SettingsData.monoFontFamily
font.weight: Font.Bold
color: {
if (!DankgopService.availableGpus || DankgopService.availableGpus.length === 0)
if (!DgopService.availableGpus || DgopService.availableGpus.length === 0)
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 temp = gpu.temperature || 0;
if (tempEnabled && temp > 80)
@@ -346,10 +346,10 @@ Row {
StyledText {
text: {
if (!DankgopService.availableGpus || DankgopService.availableGpus.length === 0)
if (!DgopService.availableGpus || DgopService.availableGpus.length === 0)
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 temp = gpu.temperature;
var hasTemp = tempEnabled && temp !== undefined && temp !== null && temp !== 0;
@@ -376,21 +376,21 @@ Row {
text: "Enable GPU Temperature"
checkable: true
checked: {
if (!DankgopService.availableGpus || DankgopService.availableGpus.length === 0) {
if (!DgopService.availableGpus || DgopService.availableGpus.length === 0) {
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
return SessionData.enabledGpuPciIds ? SessionData.enabledGpuPciIds.indexOf(gpu.pciId) !== -1 : false
}
onTriggered: {
if (!DankgopService.availableGpus || DankgopService.availableGpus.length === 0) {
if (!DgopService.availableGpus || DgopService.availableGpus.length === 0) {
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
var enabledIds = SessionData.enabledGpuPciIds ? SessionData.enabledGpuPciIds.slice() : []
@@ -398,10 +398,10 @@ Row {
if (checked && index === -1) {
enabledIds.push(gpu.pciId)
DankgopService.addGpuPciId(gpu.pciId)
DgopService.addGpuPciId(gpu.pciId)
} else if (!checked && index !== -1) {
enabledIds.splice(index, 1)
DankgopService.removeGpuPciId(gpu.pciId)
DgopService.removeGpuPciId(gpu.pciId)
}
SessionData.setEnabledGpuPciIds(enabledIds)

View File

@@ -10,10 +10,10 @@ ScrollView {
ScrollBar.vertical.policy: ScrollBar.AsNeeded
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
Component.onCompleted: {
DankgopService.addRef(["system", "hardware", "diskmounts"])
DgopService.addRef(["system", "hardware", "diskmounts"])
}
Component.onDestruction: {
DankgopService.removeRef(["system", "hardware", "diskmounts"])
DgopService.removeRef(["system", "hardware", "diskmounts"])
}
Column {
@@ -52,7 +52,7 @@ ScrollView {
spacing: Theme.spacingS
StyledText {
text: DankgopService.hostname
text: DgopService.hostname
font.pixelSize: Theme.fontSizeXLarge
font.family: SettingsData.monoFontFamily
font.weight: Font.Light
@@ -61,8 +61,8 @@ ScrollView {
}
StyledText {
text: DankgopService.distribution + " • " + DankgopService.architecture
+ " • " + DankgopService.kernelVersion
text: DgopService.distribution + " • " + DgopService.architecture
+ " • " + DgopService.kernelVersion
font.pixelSize: Theme.fontSizeMedium
font.family: SettingsData.monoFontFamily
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
@@ -71,7 +71,7 @@ ScrollView {
}
StyledText {
text: "Up " + UserInfoService.uptime + " • Boot: " + DankgopService.bootTime
text: "Up " + UserInfoService.uptime + " • Boot: " + DgopService.bootTime
font.pixelSize: Theme.fontSizeSmall
font.family: SettingsData.monoFontFamily
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
@@ -80,9 +80,9 @@ ScrollView {
}
StyledText {
text: "Load: " + DankgopService.loadAverage + " • "
+ DankgopService.processCount + " processes, "
+ DankgopService.threadCount + " threads"
text: "Load: " + DgopService.loadAverage + " • "
+ DgopService.processCount + " processes, "
+ DgopService.threadCount + " threads"
font.pixelSize: Theme.fontSizeSmall
font.family: SettingsData.monoFontFamily
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
@@ -144,7 +144,7 @@ ScrollView {
}
StyledText {
text: DankgopService.cpuModel
text: DgopService.cpuModel
font.pixelSize: Theme.fontSizeSmall
font.family: SettingsData.monoFontFamily
font.weight: Font.Medium
@@ -157,7 +157,7 @@ ScrollView {
}
StyledText {
text: DankgopService.motherboard
text: DgopService.motherboard
font.pixelSize: Theme.fontSizeSmall
font.family: SettingsData.monoFontFamily
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
@@ -170,7 +170,7 @@ ScrollView {
}
StyledText {
text: "BIOS " + DankgopService.biosVersion
text: "BIOS " + DgopService.biosVersion
font.pixelSize: Theme.fontSizeSmall
font.family: SettingsData.monoFontFamily
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
@@ -181,8 +181,8 @@ ScrollView {
}
StyledText {
text: DankgopService.formatSystemMemory(
DankgopService.totalMemoryKB) + " RAM"
text: DgopService.formatSystemMemory(
DgopService.totalMemoryKB) + " RAM"
font.pixelSize: Theme.fontSizeSmall
font.family: SettingsData.monoFontFamily
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
@@ -206,11 +206,11 @@ ScrollView {
Theme.surfaceContainerHigh.g,
Theme.surfaceContainerHigh.b, 0.6)
if (!DankgopService.availableGpus || DankgopService.availableGpus.length === 0) {
return gpuCardMouseArea.containsMouse && DankgopService.availableGpus.length > 1 ? hoverColor : baseColor
if (!DgopService.availableGpus || DgopService.availableGpus.length === 0) {
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 tintColor
@@ -221,10 +221,10 @@ ScrollView {
} else if (vendor.includes("intel")) {
tintColor = Theme.info
} 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,
(hoverColor.g + tintColor.g * 0.1) / 1.1,
(hoverColor.b + tintColor.b * 0.1) / 1.1, 0.6)
@@ -236,11 +236,11 @@ ScrollView {
}
border.width: 1
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)
}
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()
if (vendor.includes("nvidia")) {
@@ -258,12 +258,12 @@ ScrollView {
id: gpuCardMouseArea
anchors.fill: parent
hoverEnabled: true
cursorShape: DankgopService.availableGpus.length
cursorShape: DgopService.availableGpus.length
> 1 ? Qt.PointingHandCursor : Qt.ArrowCursor
onClicked: {
if (DankgopService.availableGpus.length > 1) {
if (DgopService.availableGpus.length > 1) {
var nextIndex = (SessionData.selectedGpuIndex + 1)
% DankgopService.availableGpus.length
% DgopService.availableGpus.length
SessionData.setSelectedGpuIndex(nextIndex)
}
}
@@ -301,13 +301,13 @@ ScrollView {
StyledText {
text: {
if (!DankgopService.availableGpus
|| DankgopService.availableGpus.length === 0) {
if (!DgopService.availableGpus
|| DgopService.availableGpus.length === 0) {
return "No GPUs detected"
}
var gpu = DankgopService.availableGpus[Math.min(
var gpu = DgopService.availableGpus[Math.min(
SessionData.selectedGpuIndex,
DankgopService.availableGpus.length
DgopService.availableGpus.length
- 1)]
return gpu.fullName
}
@@ -323,13 +323,13 @@ ScrollView {
StyledText {
text: {
if (!DankgopService.availableGpus
|| DankgopService.availableGpus.length === 0) {
if (!DgopService.availableGpus
|| DgopService.availableGpus.length === 0) {
return "Device: N/A"
}
var gpu = DankgopService.availableGpus[Math.min(
var gpu = DgopService.availableGpus[Math.min(
SessionData.selectedGpuIndex,
DankgopService.availableGpus.length
DgopService.availableGpus.length
- 1)]
return "Device: " + gpu.pciId
}
@@ -345,13 +345,13 @@ ScrollView {
StyledText {
text: {
if (!DankgopService.availableGpus
|| DankgopService.availableGpus.length === 0) {
if (!DgopService.availableGpus
|| DgopService.availableGpus.length === 0) {
return "Driver: N/A"
}
var gpu = DankgopService.availableGpus[Math.min(
var gpu = DgopService.availableGpus[Math.min(
SessionData.selectedGpuIndex,
DankgopService.availableGpus.length
DgopService.availableGpus.length
- 1)]
return "Driver: " + gpu.driver
}
@@ -366,13 +366,13 @@ ScrollView {
StyledText {
text: {
if (!DankgopService.availableGpus
|| DankgopService.availableGpus.length === 0) {
if (!DgopService.availableGpus
|| DgopService.availableGpus.length === 0) {
return "Temp: --°"
}
var gpu = DankgopService.availableGpus[Math.min(
var gpu = DgopService.availableGpus[Math.min(
SessionData.selectedGpuIndex,
DankgopService.availableGpus.length
DgopService.availableGpus.length
- 1)]
var temp = gpu.temperature
return "Temp: " + ((temp === undefined || temp === null
@@ -382,14 +382,14 @@ ScrollView {
font.pixelSize: Theme.fontSizeSmall
font.family: SettingsData.monoFontFamily
color: {
if (!DankgopService.availableGpus
|| DankgopService.availableGpus.length === 0) {
if (!DgopService.availableGpus
|| DgopService.availableGpus.length === 0) {
return Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
Theme.surfaceText.b, 0.7)
}
var gpu = DankgopService.availableGpus[Math.min(
var gpu = DgopService.availableGpus[Math.min(
SessionData.selectedGpuIndex,
DankgopService.availableGpus.length
DgopService.availableGpus.length
- 1)]
var temp = gpu.temperature || 0
if (temp > 80)
@@ -532,7 +532,7 @@ ScrollView {
Repeater {
id: diskMountRepeater
model: DankgopService.diskMounts
model: DgopService.diskMounts
Rectangle {
width: parent.width

View File

@@ -54,29 +54,29 @@ Item {
"text": "CPU Usage",
"description": "CPU usage indicator",
"icon": "memory",
"enabled": DankgopService.dankgopAvailable,
"warning": !DankgopService.dankgopAvailable ? "Requires 'dankgop' tool" : undefined
"enabled": DgopService.dgopAvailable,
"warning": !DgopService.dgopAvailable ? "Requires 'dgop' tool" : undefined
}, {
"id": "memUsage",
"text": "Memory Usage",
"description": "Memory usage indicator",
"icon": "storage",
"enabled": DankgopService.dankgopAvailable,
"warning": !DankgopService.dankgopAvailable ? "Requires 'dankgop' tool" : undefined
"enabled": DgopService.dgopAvailable,
"warning": !DgopService.dgopAvailable ? "Requires 'dgop' tool" : undefined
}, {
"id": "cpuTemp",
"text": "CPU Temperature",
"description": "CPU temperature display",
"icon": "device_thermostat",
"enabled": DankgopService.dankgopAvailable,
"warning": !DankgopService.dankgopAvailable ? "Requires 'dankgop' tool" : undefined
"enabled": DgopService.dgopAvailable,
"warning": !DgopService.dgopAvailable ? "Requires 'dgop' tool" : undefined
}, {
"id": "gpuTemp",
"text": "GPU Temperature",
"description": "GPU temperature display",
"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.",
"enabled": DankgopService.dankgopAvailable
"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": DgopService.dgopAvailable
}, {
"id": "systemTray",
"text": "System Tray",
@@ -315,14 +315,14 @@ Item {
"id": widget,
"enabled": true,
"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 {
var newWidget = {
"id": widget.id,
"enabled": widget.enabled,
"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
widgets[widgetIndex] = newWidget

View File

@@ -148,22 +148,22 @@ Column {
currentValue: {
var selectedIndex = modelData.selectedGpuIndex
!== undefined ? modelData.selectedGpuIndex : 0
if (DankgopService.availableGpus
&& DankgopService.availableGpus.length > selectedIndex
if (DgopService.availableGpus
&& DgopService.availableGpus.length > selectedIndex
&& selectedIndex >= 0) {
var gpu = DankgopService.availableGpus[selectedIndex]
var gpu = DgopService.availableGpus[selectedIndex]
return gpu.driver.toUpperCase()
}
return DankgopService.availableGpus
&& DankgopService.availableGpus.length
> 0 ? DankgopService.availableGpus[0].driver.toUpperCase() : ""
return DgopService.availableGpus
&& DgopService.availableGpus.length
> 0 ? DgopService.availableGpus[0].driver.toUpperCase() : ""
}
options: {
var gpuOptions = []
if (DankgopService.availableGpus
&& DankgopService.availableGpus.length > 0) {
for (var i = 0; i < DankgopService.availableGpus.length; i++) {
var gpu = DankgopService.availableGpus[i]
if (DgopService.availableGpus
&& DgopService.availableGpus.length > 0) {
for (var i = 0; i < DgopService.availableGpus.length; i++) {
var gpu = DgopService.availableGpus[i]
gpuOptions.push(gpu.driver.toUpperCase())
}
}

View File

@@ -23,10 +23,10 @@ Rectangle {
baseColor.a * Theme.widgetTransparency)
}
Component.onCompleted: {
DankgopService.addRef(["cpu"])
DgopService.addRef(["cpu"])
}
Component.onDestruction: {
DankgopService.removeRef(["cpu"])
DgopService.removeRef(["cpu"])
}
MouseArea {
@@ -45,7 +45,7 @@ Rectangle {
Theme.barHeight + Theme.spacingXS,
width, section, currentScreen)
}
DankgopService.setSortBy("cpu")
DgopService.setSortBy("cpu")
if (root.toggleProcessList)
root.toggleProcessList()
}
@@ -59,10 +59,10 @@ Rectangle {
name: "memory"
size: Theme.iconSize - 8
color: {
if (DankgopService.cpuUsage > 80)
if (DgopService.cpuUsage > 80)
return Theme.tempDanger
if (DankgopService.cpuUsage > 60)
if (DgopService.cpuUsage > 60)
return Theme.tempWarning
return Theme.surfaceText
@@ -72,12 +72,12 @@ Rectangle {
StyledText {
text: {
if (DankgopService.cpuUsage === undefined
|| DankgopService.cpuUsage === null
|| DankgopService.cpuUsage === 0) {
if (DgopService.cpuUsage === undefined
|| DgopService.cpuUsage === null
|| DgopService.cpuUsage === 0) {
return "--%"
}
return DankgopService.cpuUsage.toFixed(0) + "%"
return DgopService.cpuUsage.toFixed(0) + "%"
}
font.pixelSize: Theme.fontSizeSmall
font.weight: Font.Medium

View File

@@ -23,10 +23,10 @@ Rectangle {
baseColor.a * Theme.widgetTransparency)
}
Component.onCompleted: {
DankgopService.addRef(["cpu"])
DgopService.addRef(["cpu"])
}
Component.onDestruction: {
DankgopService.removeRef(["cpu"])
DgopService.removeRef(["cpu"])
}
MouseArea {
@@ -45,7 +45,7 @@ Rectangle {
Theme.barHeight + Theme.spacingXS,
width, section, currentScreen)
}
DankgopService.setSortBy("cpu")
DgopService.setSortBy("cpu")
if (root.toggleProcessList)
root.toggleProcessList()
}
@@ -59,10 +59,10 @@ Rectangle {
name: "memory"
size: Theme.iconSize - 8
color: {
if (DankgopService.cpuTemperature > 85)
if (DgopService.cpuTemperature > 85)
return Theme.tempDanger
if (DankgopService.cpuTemperature > 69)
if (DgopService.cpuTemperature > 69)
return Theme.tempWarning
return Theme.surfaceText
@@ -72,12 +72,12 @@ Rectangle {
StyledText {
text: {
if (DankgopService.cpuTemperature === undefined
|| DankgopService.cpuTemperature === null
|| DankgopService.cpuTemperature < 0) {
if (DgopService.cpuTemperature === undefined
|| DgopService.cpuTemperature === null
|| DgopService.cpuTemperature < 0) {
return "--°"
}
return Math.round(DankgopService.cpuTemperature) + "°"
return Math.round(DgopService.cpuTemperature) + "°"
}
font.pixelSize: Theme.fontSizeSmall
font.weight: Font.Medium

View File

@@ -37,12 +37,12 @@ Rectangle {
baseColor.a * Theme.widgetTransparency)
}
Component.onCompleted: {
DankgopService.addRef(["gpu"])
DgopService.addRef(["gpu"])
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
if (widgetData && widgetData.pciId) {
console.log("Adding GPU PCI ID to service:", widgetData.pciId)
DankgopService.addGpuPciId(widgetData.pciId)
DgopService.addGpuPciId(widgetData.pciId)
} else {
console.log("No PCI ID in widget data, starting auto-detection")
// No PCI ID saved, auto-detect and save the first GPU
@@ -50,20 +50,20 @@ Rectangle {
}
}
Component.onDestruction: {
DankgopService.removeRef(["gpu"])
DgopService.removeRef(["gpu"])
// Remove this widget's PCI ID from the service
if (widgetData && widgetData.pciId) {
DankgopService.removeGpuPciId(widgetData.pciId)
DgopService.removeGpuPciId(widgetData.pciId)
}
}
property real displayTemp: {
if (!DankgopService.availableGpus
|| DankgopService.availableGpus.length === 0)
if (!DgopService.availableGpus
|| DgopService.availableGpus.length === 0)
return 0
if (selectedGpuIndex >= 0
&& selectedGpuIndex < DankgopService.availableGpus.length) {
return DankgopService.availableGpus[selectedGpuIndex].temperature || 0
&& selectedGpuIndex < DgopService.availableGpus.length) {
return DgopService.availableGpus[selectedGpuIndex].temperature || 0
}
return 0
}
@@ -84,7 +84,7 @@ Rectangle {
Theme.barHeight + Theme.spacingXS,
width, section, currentScreen)
}
DankgopService.setSortBy("cpu")
DgopService.setSortBy("cpu")
if (root.toggleProcessList)
root.toggleProcessList()
}
@@ -136,12 +136,12 @@ Rectangle {
interval: 100
running: false
onTriggered: {
if (DankgopService.availableGpus && DankgopService.availableGpus.length > 0) {
const firstGpu = DankgopService.availableGpus[0]
if (DgopService.availableGpus && DgopService.availableGpus.length > 0) {
const firstGpu = DgopService.availableGpus[0]
if (firstGpu && firstGpu.pciId) {
// Save the first GPU's PCI ID to this widget's settings
updateWidgetPciId(firstGpu.pciId)
DankgopService.addGpuPciId(firstGpu.pciId)
DgopService.addGpuPciId(firstGpu.pciId)
}
}
}

View File

@@ -23,10 +23,10 @@ Rectangle {
baseColor.a * Theme.widgetTransparency)
}
Component.onCompleted: {
DankgopService.addRef(["memory"])
DgopService.addRef(["memory"])
}
Component.onDestruction: {
DankgopService.removeRef(["memory"])
DgopService.removeRef(["memory"])
}
MouseArea {
@@ -45,7 +45,7 @@ Rectangle {
Theme.barHeight + Theme.spacingXS,
width, section, currentScreen)
}
DankgopService.setSortBy("memory")
DgopService.setSortBy("memory")
if (root.toggleProcessList)
root.toggleProcessList()
}
@@ -59,10 +59,10 @@ Rectangle {
name: "developer_board"
size: Theme.iconSize - 8
color: {
if (DankgopService.memoryUsage > 90)
if (DgopService.memoryUsage > 90)
return Theme.tempDanger
if (DankgopService.memoryUsage > 75)
if (DgopService.memoryUsage > 75)
return Theme.tempWarning
return Theme.surfaceText
@@ -72,12 +72,12 @@ Rectangle {
StyledText {
text: {
if (DankgopService.memoryUsage === undefined
|| DankgopService.memoryUsage === null
|| DankgopService.memoryUsage === 0) {
if (DgopService.memoryUsage === undefined
|| DgopService.memoryUsage === null
|| DgopService.memoryUsage === 0) {
return "--%"
}
return DankgopService.memoryUsage.toFixed(0) + "%"
return DgopService.memoryUsage.toFixed(0) + "%"
}
font.pixelSize: Theme.fontSizeSmall
font.weight: Font.Medium

View File

@@ -60,9 +60,9 @@ PanelWindow {
return widgetId === "gpuTemp" && widgetEnabled
})
DankgopService.gpuTempEnabled = hasGpuTempWidget || SessionData.nvidiaGpuTempEnabled || SessionData.nonNvidiaGpuTempEnabled
DankgopService.nvidiaGpuTempEnabled = hasGpuTempWidget || SessionData.nvidiaGpuTempEnabled
DankgopService.nonNvidiaGpuTempEnabled = hasGpuTempWidget || SessionData.nonNvidiaGpuTempEnabled
DgopService.gpuTempEnabled = hasGpuTempWidget || SessionData.nvidiaGpuTempEnabled || SessionData.nonNvidiaGpuTempEnabled
DgopService.nvidiaGpuTempEnabled = hasGpuTempWidget || SessionData.nvidiaGpuTempEnabled
DgopService.nonNvidiaGpuTempEnabled = hasGpuTempWidget || SessionData.nonNvidiaGpuTempEnabled
}
Connections {
@@ -279,13 +279,13 @@ PanelWindow {
case "clipboard":
return true
case "cpuUsage":
return DankgopService.dankgopAvailable
return DgopService.dgopAvailable
case "memUsage":
return DankgopService.dankgopAvailable
return DgopService.dgopAvailable
case "cpuTemp":
return DankgopService.dankgopAvailable
return DgopService.dgopAvailable
case "gpuTemp":
return DankgopService.dankgopAvailable
return DgopService.dgopAvailable
case "notificationButton":
return true
case "battery":

View File

@@ -157,15 +157,15 @@ rm /tmp/FiraCode.zip && fc-cache -f
**Enhanced Functionality:**
```bash
# Install dankgop on any distro (requires go 1.23+):
git clone https://github.com/AvengeMedia/dankgop.git && cd dankgop
# Install dgop on any distro (requires go 1.23+):
git clone https://github.com/AvengeMedia/dgop.git && cd dgop
make && sudo make install
```
```bash
# Arch Linux
pacman -S cava wl-clipboard cliphist ddcutil brightnessctl
paru -S matugen dankgop-git
paru -S matugen dgop-git
# Fedora
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:**
- `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
- `ddcutil`: External monitor brightness control
- `brightnessctl`: Laptop display brightness

View File

@@ -11,7 +11,7 @@ Singleton {
property int refCount: 0
property int updateInterval: refCount > 0 ? 3000 : 30000
property bool isUpdating: false
property bool dankgopAvailable: false
property bool dgopAvailable: false
property var moduleRefCounts: ({})
property var enabledModules: []
@@ -205,22 +205,22 @@ Singleton {
}
function updateAllStats() {
if (dankgopAvailable && refCount > 0 && enabledModules.length > 0) {
if (dgopAvailable && refCount > 0 && enabledModules.length > 0) {
isUpdating = true
dankgopProcess.running = true
dgopProcess.running = true
} else {
isUpdating = false
}
}
function initializeGpuMetadata() {
if (!dankgopAvailable) return
if (!dgopAvailable) return
// Load GPU metadata once at startup for basic info
gpuInitProcess.running = true
}
function buildDankgopCommand() {
const cmd = ["dankgop", "meta", "--json"]
function buildDgopCommand() {
const cmd = ["dgop", "meta", "--json"]
if (enabledModules.length === 0) {
// Don't run if no modules are needed
@@ -281,7 +281,7 @@ Singleton {
const cpu = data.cpu
cpuSampleCount++
// Use dankgop CPU numbers directly without modification
// Use dgop CPU numbers directly without modification
cpuUsage = cpu.usage || 0
cpuFrequency = cpu.frequency || 0
cpuTemperature = cpu.temperature || 0
@@ -516,22 +516,22 @@ Singleton {
Timer {
id: updateTimer
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
triggeredOnStart: true
onTriggered: root.updateAllStats()
}
Process {
id: dankgopProcess
command: root.buildDankgopCommand()
id: dgopProcess
command: root.buildDgopCommand()
running: false
onCommandChanged: {
//console.log("DankgopService command:", JSON.stringify(command))
//console.log("DgopService command:", JSON.stringify(command))
}
onExited: exitCode => {
if (exitCode !== 0) {
console.warn("Dankgop process failed with exit code:", exitCode)
console.warn("Dgop process failed with exit code:", exitCode)
isUpdating = false
}
}
@@ -542,7 +542,7 @@ Singleton {
const data = JSON.parse(text.trim())
parseData(data)
} 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))
isUpdating = false
}
@@ -553,7 +553,7 @@ Singleton {
Process {
id: gpuInitProcess
command: ["dankgop", "gpu", "--json"]
command: ["dgop", "gpu", "--json"]
running: false
onExited: exitCode => {
if (exitCode !== 0) {
@@ -575,12 +575,12 @@ Singleton {
}
Process {
id: dankgopCheckProcess
command: ["which", "dankgop"]
id: dgopCheckProcess
command: ["which", "dgop"]
running: false
onExited: exitCode => {
dankgopAvailable = (exitCode === 0)
if (dankgopAvailable) {
dgopAvailable = (exitCode === 0)
if (dgopAvailable) {
initializeGpuMetadata()
// Load persisted GPU PCI IDs from session state
if (SessionData.enabledGpuPciIds && SessionData.enabledGpuPciIds.length > 0) {
@@ -593,12 +593,12 @@ Singleton {
}
}
} else {
console.warn("dankgop is not installed or not in PATH")
console.warn("dgop is not installed or not in PATH")
}
}
}
Component.onCompleted: {
dankgopCheckProcess.running = true
dgopCheckProcess.running = true
}
}