Skip to content

Commit

Permalink
fix iwd connected status
Browse files Browse the repository at this point in the history
  • Loading branch information
maximbaz committed Jul 25, 2024
1 parent 540c642 commit 51b4149
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/iwd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ fn parse_iwd_networks(
let line = ansi_escape.replace_all(&network, "").to_string();
let parts: Vec<&str> = line.split_whitespace().collect();
if parts.len() >= 3 {
let connected = parts.len() > 3;
// using network is on purpose, parts has color stripped, which includes "connected" icon
let connected = network.split_whitespace().count() > 3;
let ssid = parts[0].trim();
let security = parts[1].trim();
let signal = parts[2].trim();
Expand Down

0 comments on commit 51b4149

Please sign in to comment.