We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 941cbf5 commit 3670f12Copy full SHA for 3670f12
cosmic-applet-battery/src/dgpu.rs
@@ -222,7 +222,11 @@ impl Gpu {
222
Some(
223
smi_output
224
.lines()
225
- .filter(|line| !line.starts_with('#'))
+ .filter(|line| {
226
+ // smi shows an empty line filled with - when no app is running
227
+ let components = line.split_whitespace().collect::<Vec<_>>();
228
+ components[1].trim().ne("-") && !line.starts_with('#')
229
+ })
230
.map(|line| {
231
let components = line.split_whitespace().collect::<Vec<_>>();
232
let pid = components[1].trim();
0 commit comments