Skip to content

Commit

Permalink
fix: show empty dropdown menu when no app uses dGPU
Browse files Browse the repository at this point in the history
  • Loading branch information
GroobleDierne authored Sep 24, 2024
1 parent 941cbf5 commit 3670f12
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cosmic-applet-battery/src/dgpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,11 @@ impl Gpu {
Some(
smi_output
.lines()
.filter(|line| !line.starts_with('#'))
.filter(|line| {
// smi shows an empty line filled with - when no app is running
let components = line.split_whitespace().collect::<Vec<_>>();
components[1].trim().ne("-") && !line.starts_with('#')
})
.map(|line| {
let components = line.split_whitespace().collect::<Vec<_>>();
let pid = components[1].trim();
Expand Down

0 comments on commit 3670f12

Please sign in to comment.