Closed siebenmann closed 9 months ago
It seems that network-manager-applet itself supports activating WireGuard connections, but cinnamon's applet (which from my understanding, depends on the original applet? not sure) does not.
I tried removing the cinnamon network applet from the taskbar and running nm-applet
by itself. Sure enough, under VPN connections there are both WireGuard and OpenVPN entries to toggle.
It would also be nice if one could import wireguard configurations. From the command line, it can be done with:
nmcli connection import type wireguard file <file>
My search on how to toggle a WireGuard connection from my taskbar in Linux Mint (Cinnamon 5.4.12
)brought me here.
For people wondering how to do this in a non-technical but somewhat cumbersome way until this issue is resolved:
To toggle on:
Network Connections
General
tabconnect automatically with priority
set to 0
save
and closeTo toggle off:
Network Settings
and note that your WireGuard connection is now (temporarily) listedSame as above, and I found another solution:
nmcli connection up <your_interface>
and nmcli connection down <your_interface>
commands.Additionally, to make the status icon update based on the connection's status, save the following as e.g. /etc/NetworkManager/dispatcher.d/update-vpn-status.sh
and adjust the 3 <xxx>
markers:
#!/bin/sh
iface_name="<your_interface>"
applet_config_file="/home/<your_username>/.config/cinnamon/spices/app-launcher@mchilli/<some_number>.json"
if ! [ "$1" = "${iface_name}" ]
then
exit 0
fi
if [ "$2" = "up" ]
then
icon="network-vpn-symbolic"
elif [ "$2" = "down" ]
then
icon="network-vpn-disabled-symbolic"
else
exit 0
fi
new_json="$(jq ".[\"launcher-icon\"].value = \"${icon}\"" "${applet_config_file}")"
echo -E "${new_json}" > "${applet_config_file}"
Did you try the VPN-Sentinel applet? I'm using Wireguard connections with it. https://cinnamon-spices.linuxmint.com/applets/view/368
VPN-Sentinel works, but I still find this request appropriate (avoiding unnecesary additions for a single use of turning the connection on and off). I think I read that XFCE supports WireGuard in NM, just Cinnamon not.
Note (in addition to this request): not sure if this one can be made to work in Cinnamon, it assumes WireGuard is a type of VPN connection, which sounds OK, but needs a change of parameters for normal wireguard connections which have it's own type.. https://github.com/max-moser/network-manager-wireguard
NM supports Wireguard since version 1.16. https://blogs.gnome.org/thaller/2019/03/15/wireguard-in-networkmanager/
To know what is your version:
nmcli --version
This is what I would like too. Wireguard should be under VPN section of Network Manager. This way I could easily specify what connections should use my Wireguard VPN connection and what should not. I remember that it's also possible to just import the client .conf file directly from Network Manager GUI on other platforms. It's bizarre how this is not possible on Linux Mint Cinnamon, while for example it is possible on Linux Mint Mate.
i used xfce with wireguard like a charm, i can turn on or off wireguard connections. but when i do that in cinnamons nm applet (turning off wireguard connection), its "gone". there is no way to activate it again in the gui, only with nm cli. that just s*cks. would be nice to have this basic functionality.
One more aspect of this: today I tried to "import new VPN" via Network Connections using file with WireGuard configuration, it does not work. I added the file conf. via nmcli.
The PR #11905 try to fix this issue. Can you test it (after saving the original applet.js script) please?
As seen in PR comments, this works well and should be in merged in Cinnamon IMO. Also there are some detals to clarify.
Thanks a lot @claudiux . As noted in PR, network connections have "Automatically connect to VPN" and there should also be another check box for "Automatically connect to Wireguard". If done, please link here.
It seems to me that it would be good to be able to prevent the network icon changing to the 'secure' icon. For, the key icon does not immediately put one in mind of networks, and (accordingly) one might have another program, such as the popular KeePassXC, whichuses the key icon. My panel is in the following unfortunate situation - note the two key icons.
Issue The Network Manager applet doesn't support WireGuard connections, although current versions of NetworkManager do. Such connections aren't shown in the list of networks that you can select (under any category) and there's no sign if one is active or inactive.
NetworkManager reports WireGuard connections as a new type, "wireguard", instead of as type "vpn". Based on looking at the code in files/usr/share/cinnamon/applets/network@cinnamon.org/applet.js, a simple solution might be to add a case for WireGuard connections to the this._ctypes variable that maps NetworkManager types to categories, as a 'vpn' connection. Probably most people using WireGuard connections (especially through the applet) are using them as a form of VPN, instead of more complex usage cases that might want them to be treated separately.
Steps to reproduce Configure a WireGuard connection in NetworkManager, then attempt to see it in Cinnamon.
Expected behaviour You can activate and deactivate a WireGuard connection.