Ajout de Wireguard dans la conf waybar

This commit is contained in:
Damien Broqua 2022-11-14 09:04:01 +01:00
parent 17c8d2f4ab
commit da28776049
3 changed files with 23 additions and 9 deletions

View File

@ -149,7 +149,7 @@
"custom/clock",
],
"modules-right": [
"network#openvpn",
"custom/vpn",
"network",
"temperature",
"cpu",
@ -204,6 +204,14 @@
"tooltip": true,
"interval": 60,
},
"custom/vpn": {
"format": "{icon}",
"tooltip-format": "{icon}",
"exec": "$HOME/.config/waybar/modules/vpn_echo.sh",
"return-type": "json",
"interval": 5,
"format-icons": ["",""]
},
"network#openvpn": {
"interface": "tun0",
"format": "🔒",

View File

@ -0,0 +1,4 @@
#!/bin/bash
ip addr | grep -q '10.10.10.2' \
&& echo '{"text":"Connected","class":"connected","percentage":100}' \
|| echo '{"text":"Disconnected","class":"disconnected","percentage":0}'

View File

@ -20,6 +20,7 @@ window#waybar.laptop {
#mode,
#disk,
#network,
#custom-vpn,
#cpu,
#memory,
#temperature,
@ -59,6 +60,7 @@ window#waybar.laptop {
background: rgba(208, 135, 112, 0.7);
}
#custom-vpn.disconnected,
#network.disconnected {
background: rgba(191, 97, 106, 0.7);
}