summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-08-25 17:37:04 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-08-25 17:37:04 +1000
commit842249e05ae84dbdba1b4f4b50af2b7bf45826e2 (patch)
tree678af884cd1815c75f9b8db7440f98be5756c295
parentbeatdetector: increase default bpm (diff)
downloadcaelestia-shell-842249e05ae84dbdba1b4f4b50af2b7bf45826e2.tar.gz
caelestia-shell-842249e05ae84dbdba1b4f4b50af2b7bf45826e2.tar.bz2
caelestia-shell-842249e05ae84dbdba1b4f4b50af2b7bf45826e2.zip
config: add gpu type config
-rw-r--r--README.md1
-rw-r--r--config/ServiceConfig.qml1
-rw-r--r--services/SystemUsage.qml8
3 files changed, 7 insertions, 3 deletions
diff --git a/README.md b/README.md
index 731c1f1..2e67883 100644
--- a/README.md
+++ b/README.md
@@ -316,6 +316,7 @@ All configuration options are in `~/.config/caelestia/shell.json`.
"services": {
"audioIncrement": 0.1,
"defaultPlayer": "Spotify",
+ "gpuType": "",
"playerAliases": [{
"com.github.th_ch.youtube_music": "YT Music"
}],
diff --git a/config/ServiceConfig.qml b/config/ServiceConfig.qml
index 4124147..cca554b 100644
--- a/config/ServiceConfig.qml
+++ b/config/ServiceConfig.qml
@@ -5,6 +5,7 @@ JsonObject {
property string weatherLocation: "" // A lat,long pair or empty for autodetection, e.g. "37.8267,-122.4233"
property bool useFahrenheit: [Locale.ImperialUSSystem, Locale.ImperialSystem].includes(Qt.locale().measurementSystem)
property bool useTwelveHourClock: Qt.locale().timeFormat(Locale.ShortFormat).toLowerCase().includes("a")
+ property string gpuType: ""
property real audioIncrement: 0.1
property bool smartScheme: true
property string defaultPlayer: "Spotify"
diff --git a/services/SystemUsage.qml b/services/SystemUsage.qml
index 6ee4e42..bd02da3 100644
--- a/services/SystemUsage.qml
+++ b/services/SystemUsage.qml
@@ -1,5 +1,6 @@
pragma Singleton
+import qs.config
import Quickshell
import Quickshell.Io
import QtQuick
@@ -9,7 +10,8 @@ Singleton {
property real cpuPerc
property real cpuTemp
- property string gpuType: "NONE"
+ readonly property string gpuType: Config.services.gpuType.toUpperCase() || autoGpuType
+ property string autoGpuType: "NONE"
property real gpuPerc
property real gpuTemp
property real memUsed
@@ -141,10 +143,10 @@ Singleton {
Process {
id: gpuTypeCheck
- running: true
+ running: !Config.services.gpuType
command: ["sh", "-c", "if command -v nvidia-smi &>/dev/null && nvidia-smi -L &>/dev/null; then echo NVIDIA; elif ls /sys/class/drm/card*/device/gpu_busy_percent 2>/dev/null | grep -q .; then echo GENERIC; else echo NONE; fi"]
stdout: StdioCollector {
- onStreamFinished: root.gpuType = text.trim()
+ onStreamFinished: root.autoGpuType = text.trim()
}
}