Fix mullvad vpn#2270
Conversation
|
Has the JSON output flag always been there or is it only in certain newer versions of mullvad cli? |
|
It's been there since the beginning of 2025. Do you prefer adding a check to see if the flag is available and if not fall back to the old parsing? |
|
The goal is not to break user's config if it is not guaranteed that all users have a version > 2025. It depends how users usually install mullvad. If it is not from a distro package manager then likely we can assume most or all users will have the latest mullvad client version. Since I do not use mullvad I am not sure - can you advise? |
|
I think it is fine in this case as I think very few users would be on such an old version and the app would warn them that they are using an outdated version as well. The offical Mullvad Ubuntu and Fedora repos as well as the AUR package all have the latest version of Mullvad. I also added a commit fixing an issue I found with the mullvad json status command. |
The Mullvad status parsing was done by calling
mullvad statusand parsing this output which has changed so the country code was not extracted correctly.This PR changes that instead parse the JSON output from
mullvad status -j, which should be more robust.It also adds a connecting state to the VPN block so that the error icon is not shown when the VPN is connecting. Note that I only implemented the connecting state for Mullvad, so the other VPNs will behave as they did before and show the error icon when connecting.
Closes: #1882