Skip to content

Commit f39f4ca

Browse files
committed
theme: Replace wmic with PowerShell command to query GPU
It seems `wmic` wasn't ever intended to be used outside of dev machines, and it is not available on some systems.
1 parent cdf4b0e commit f39f4ca

File tree

1 file changed

+7
-1
lines changed
  • theme/src/main/kotlin/earth/groundctrl/fluent/lib

1 file changed

+7
-1
lines changed

theme/src/main/kotlin/earth/groundctrl/fluent/lib/Windows.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,13 @@ object Windows {
2626
}
2727

2828
fun isAmdGpu(): Boolean {
29-
val process = Runtime.getRuntime().exec(arrayOf("wmic", "PATH", "Win32_videocontroller", "GET", "description"))
29+
val process = Runtime.getRuntime().exec(
30+
arrayOf(
31+
"powershell",
32+
"-command",
33+
""""(Get-WmiObject -class Win32_VideoController -Property Description).Description""""
34+
)
35+
)
3036
val output = BufferedReader(InputStreamReader(process.inputStream)).use { it.readText() }
3137
return "AMD" in output.uppercase()
3238
}

0 commit comments

Comments
 (0)