For not entering the password every times you want to connect or disconnect, replace in ~/.local/share/cinnamon/applets/wireguard@nicoulaj.net/applet.js 'pkexec' by 'sudo' line 123 :
replace :
```
['pkexec', 'wg-quick', enable ? 'up' : 'down', iface],
```
by :
```
['sudo', 'wg-quick', enable ? 'up' : 'down', iface],
```
Then in sudo visudo add this line : with no empty line :
```
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
YOUR_USER_NAME ALL=(ALL) NOPASSWD: /usr/bin/wg-quick
# See sudoers(5) for more information on "@include" directives:
```
Replace YOUR_USER_NAME by your username or ALL
########################
The config files need to be in /etc/wireguard/ (e.g /etc/wireguard/wg0.conf) as @ziogref said
And you must let access for reading to your username to the folder wiregard
########################
Finnaly restart Cinnamon to make it works
- To let reading access for your username to the folder wiregard : sudo chmod o+r /etc/wireguard
- To restart Cinnamon : ( Alt+F2, type r and hit enter)
Wireguard config files need to be in /etc/wireguard/ (e.g /etc/wireguard/wg0.conf)
Probably for future me, but this is where the plugin looks for the wireguard profiles.
I couldn't get this to work either, but If you only have one vpn you can use the applet "Bash Sensors" instead.
Since wg-quick needs sudo, I added the following line with visudo:
ALL ALL=(root) NOPASSWD: /usr/bin/wg-quick
Warning: This is a huge security risk! Since wg_quick a bash script, you're giving root access to anyone who can edit it.
I used these settings for Bash Sensors:
- Refresh interval: 10 sec
- Shell: sh
- Command 1: echo ''
- Two-line mode: Off
- Dynamic icon: On
- Cmd: ls /sys/class/net | grep <wg config name> > /dev/null && echo "<path to On icon>" || echo "<path to Off icon>"
Note: PNG's can be used for icons. These are the ones I used:
https://findicons.com/files/icons/1933/symbols/128/green_light.pnghttps://findicons.com/files/icons/1933/symbols/128/red_light.png
- Dynamic tooltip: On
- Cmd: ls /sys/class/net | grep <wg config name> > /dev/null && echo "<wg config name>: UP" || echo "<wg config name>: DOWN"
- Menu command (on applet left-click): ls /sys/class/net | grep <wg config name> > /dev/null && sudo wg-quick up <wg config name> || sudo wg-quick down <wg config name>
- Display output: Off
My config for the lazy (~/.cinnamon/configs/bash-sensors@pkkk/45.json):
https://pastebin.com/KqQQNcJc
I can't find any way to edit my comment, but the "Menu command (on applet left-click)" part is wrong. It should be:
"ls /sys/class/net | grep <wg config name> && sudo wg-quick down <wg config name> || sudo wg-quick up <wg config name>".
The file on pastebin is updated, you can import it by clicking the "hamburger" icon and import. Then fix the icon paths and change all instances of "integrity_vpn" to the name of your WireGuard config.
Hello everytime my kernel updates your extension breaks it seems it has to do with the name of the updated file i was wondering if you can update this applet to detect those changes
What distribution do you use ?
Anyway wireguard is a kernel module, so after a kernel update you need to reboot or at least reload it, it depends on how it is handled on your distribution.
But I guess the extension could detect this situation and show a proper error, please file an issue at https://github.com/nicoulaj/cinnamon-applet-wireguard
Log In To Comment!
10 Comments