mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-27 06:52:50 -05:00
migrate to dankgop monitoring
This commit is contained in:
@@ -20,6 +20,7 @@ Singleton {
|
||||
property int selectedGpuIndex: 0
|
||||
property bool nvidiaGpuTempEnabled: false
|
||||
property bool nonNvidiaGpuTempEnabled: false
|
||||
property var enabledGpuPciIds: []
|
||||
|
||||
Component.onCompleted: {
|
||||
loadSettings()
|
||||
@@ -43,6 +44,7 @@ Singleton {
|
||||
selectedGpuIndex = settings.selectedGpuIndex !== undefined ? settings.selectedGpuIndex : 0
|
||||
nvidiaGpuTempEnabled = settings.nvidiaGpuTempEnabled !== undefined ? settings.nvidiaGpuTempEnabled : false
|
||||
nonNvidiaGpuTempEnabled = settings.nonNvidiaGpuTempEnabled !== undefined ? settings.nonNvidiaGpuTempEnabled : false
|
||||
enabledGpuPciIds = settings.enabledGpuPciIds !== undefined ? settings.enabledGpuPciIds : []
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
@@ -59,7 +61,8 @@ Singleton {
|
||||
"pinnedApps": pinnedApps,
|
||||
"selectedGpuIndex": selectedGpuIndex,
|
||||
"nvidiaGpuTempEnabled": nvidiaGpuTempEnabled,
|
||||
"nonNvidiaGpuTempEnabled": nonNvidiaGpuTempEnabled
|
||||
"nonNvidiaGpuTempEnabled": nonNvidiaGpuTempEnabled,
|
||||
"enabledGpuPciIds": enabledGpuPciIds
|
||||
}, null, 2))
|
||||
}
|
||||
|
||||
@@ -139,6 +142,11 @@ Singleton {
|
||||
saveSettings()
|
||||
}
|
||||
|
||||
function setEnabledGpuPciIds(pciIds) {
|
||||
enabledGpuPciIds = pciIds
|
||||
saveSettings()
|
||||
}
|
||||
|
||||
FileView {
|
||||
id: settingsFile
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ Singleton {
|
||||
property bool showCpuTemp: true
|
||||
property bool showGpuTemp: true
|
||||
property int selectedGpuIndex: 0
|
||||
property var enabledGpuPciIds: []
|
||||
property bool showSystemTray: true
|
||||
property bool showClock: true
|
||||
property bool showNotificationButton: true
|
||||
@@ -187,6 +188,7 @@ Singleton {
|
||||
showCpuTemp = settings.showCpuTemp !== undefined ? settings.showCpuTemp : true
|
||||
showGpuTemp = settings.showGpuTemp !== undefined ? settings.showGpuTemp : true
|
||||
selectedGpuIndex = settings.selectedGpuIndex !== undefined ? settings.selectedGpuIndex : 0
|
||||
enabledGpuPciIds = settings.enabledGpuPciIds !== undefined ? settings.enabledGpuPciIds : []
|
||||
showSystemTray = settings.showSystemTray !== undefined ? settings.showSystemTray : true
|
||||
showClock = settings.showClock !== undefined ? settings.showClock : true
|
||||
showNotificationButton = settings.showNotificationButton
|
||||
@@ -291,6 +293,7 @@ Singleton {
|
||||
"showCpuTemp": showCpuTemp,
|
||||
"showGpuTemp": showGpuTemp,
|
||||
"selectedGpuIndex": selectedGpuIndex,
|
||||
"enabledGpuPciIds": enabledGpuPciIds,
|
||||
"showSystemTray": showSystemTray,
|
||||
"showClock": showClock,
|
||||
"showNotificationButton": showNotificationButton,
|
||||
@@ -453,6 +456,11 @@ Singleton {
|
||||
saveSettings()
|
||||
}
|
||||
|
||||
function setEnabledGpuPciIds(pciIds) {
|
||||
enabledGpuPciIds = pciIds
|
||||
saveSettings()
|
||||
}
|
||||
|
||||
function setShowSystemTray(enabled) {
|
||||
showSystemTray = enabled
|
||||
saveSettings()
|
||||
@@ -508,6 +516,7 @@ Singleton {
|
||||
var enabled = typeof order[i] === "string" ? true : order[i].enabled
|
||||
var size = typeof order[i] === "string" ? undefined : order[i].size
|
||||
var selectedGpuIndex = typeof order[i] === "string" ? undefined : order[i].selectedGpuIndex
|
||||
var pciId = typeof order[i] === "string" ? undefined : order[i].pciId
|
||||
|
||||
var item = {
|
||||
"widgetId": widgetId,
|
||||
@@ -519,6 +528,9 @@ Singleton {
|
||||
if (selectedGpuIndex !== undefined) {
|
||||
item.selectedGpuIndex = selectedGpuIndex
|
||||
}
|
||||
if (pciId !== undefined) {
|
||||
item.pciId = pciId
|
||||
}
|
||||
listModel.append(item)
|
||||
}
|
||||
// Emit signal to notify widgets that data has changed
|
||||
@@ -528,7 +540,7 @@ Singleton {
|
||||
function resetTopBarWidgetsToDefault() {
|
||||
var defaultLeft = ["launcherButton", "workspaceSwitcher", "focusedWindow"]
|
||||
var defaultCenter = ["music", "clock", "weather"]
|
||||
var defaultRight = ["systemTray", "clipboard", "cpuUsage", "memUsage", "notificationButton", "battery", "controlCenterButton"]
|
||||
var defaultRight = ["systemTray", "clipboard", "notificationButton", "battery", "controlCenterButton"]
|
||||
|
||||
topBarLeftWidgets = defaultLeft
|
||||
topBarCenterWidgets = defaultCenter
|
||||
|
||||
Reference in New Issue
Block a user