i3status-rust
i3status-rust copied to clipboard
net block: `OpenConnect` vpn not detected
What does ip a show when connected to OpenConnect vpn?
This is the logic used to determine the icon: https://github.com/greshake/i3status-rust/blob/5f7febee59bd86d41ec0aeef3ee57713d3f702de/src/netlink.rs#L98-L111
I've just stumbled over the same question and I checked the code: I believe this happens because the "if-clause" defining the icon is greedy.
I'm no Rust-programmer and am not 100% sure what wifi_info.is_some() returns, but I assume it is true.
In the case of additional VPN connection the tun-flag is never processed because the value of icon is already defined as net_wireless.
I'm not sure what exactly to do with that, because any change here would break the current behavior of showing WIFI instead of the VPN symbol - not sure if a change is desired.
Perhaps it would be nice to expose another placeholder for the block that one could use in addition to icon?
EDIT: for sake of completeness, ip a shows the tun interface and should be matched by the logic in the code
6: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1380 qdisc fq_codel state UNKNOWN group default qlen 500
link/none
inet 1xxxxx scope global tun0
valid_lft forever preferred_lft forever
inet6 fe80:xxxx scope link stable-privacy proto kernel_ll
valid_lft forever preferred_lft forever