New backup 2025-08-31 14:00:02
This commit is contained in:
parent
fc5c14e69d
commit
abc99e0205
2 changed files with 34 additions and 10 deletions
|
@ -16,7 +16,13 @@
|
|||
:halign "center"
|
||||
(button :onclick 'scripts/bar/nmcli-vpn "HomeVPN"'
|
||||
:class {network_status.homevpn ? "active" : "inactive"}
|
||||
{network_status.homevpn ? " " : " "})
|
||||
(button :onclick 'scripts/bar/nmcli-vpn "Proton SE-NL"'
|
||||
{network_status.homevpn ? " " : " "})
|
||||
(button :onclick 'scripts/bar/nmcli-vpn "HomeVPN-Full"'
|
||||
:class {network_status.homevpn_full ? "active" : "inactive"}
|
||||
{network_status.homevpn ? " " : " "})
|
||||
(button :onclick 'scripts/bar/nmcli-vpn "ProtonVPN"'
|
||||
:class {network_status.proton ? "active" : "inactive"}
|
||||
{network_status.proton ? " " : " "})))
|
||||
{network_status.homevpn ? " " : " "})
|
||||
(button :onclick 'scripts/bar/nmcli-vpn "ProtonVPN-SC"'
|
||||
:class {network_status.proton_sc ? "active" : "inactive"}
|
||||
{network_status.proton ? " " : " "})))
|
||||
|
|
|
@ -5,7 +5,9 @@ function ifstatus(){
|
|||
is_wireless=false
|
||||
is_ethernet=false
|
||||
is_proton=false
|
||||
is_proton_sc=false
|
||||
is_homevpn=false
|
||||
is_homevpn_full=false
|
||||
|
||||
if nmcli -g TYPE connection show --active | grep -q "wireless";then
|
||||
is_wireless='true'
|
||||
|
@ -13,13 +15,29 @@ function ifstatus(){
|
|||
if nmcli -g TYPE connection show --active | grep -q "ethernet";then
|
||||
is_ethernet='true'
|
||||
fi
|
||||
if nmcli -g TYPE,NAME connection show --active | grep -e "vpn" -e "wireguard" | grep -qi "proton";then
|
||||
is_proton='true'
|
||||
fi
|
||||
if nmcli -g TYPE,NAME connection show --active | grep -e "vpn" -e "wireguard" | grep -qi "home";then
|
||||
is_homevpn='true'
|
||||
fi
|
||||
echo $(jq -n --arg wifi "${is_wireless}" --arg wired "${is_ethernet}" --arg proton "${is_proton}" --arg homevpn "${is_homevpn}" '{wifi: $wifi, wired: $wired, proton: $proton, homevpn: $homevpn}')
|
||||
vpn_cons=$(nmcli -g TYPE,NAME connection show --active | grep -e "vpn" -e "wireguard")
|
||||
|
||||
case ${vpn_cons} in
|
||||
*ProtonVPN)
|
||||
is_proton='true'
|
||||
;;
|
||||
*ProtonVPN-SC)
|
||||
is_proton_sc='true'
|
||||
;;
|
||||
esac
|
||||
# if grep -qe "ProtonVPN$" <<<${vpn_cons};then
|
||||
# is_proton='true'
|
||||
# fi
|
||||
# if grep -qe "ProtonVPN-SC$" <<<${vpn_cons};then
|
||||
# is_proton_sc='true'
|
||||
# fi
|
||||
# if grep -qe "HomeVPN$" <<<${vpn_cons};then
|
||||
# is_homevpn='true'
|
||||
# fi
|
||||
# if grep -qe "HomeVPN-Full$" <<<${vpn_cons};then
|
||||
# is_homevpn_full='true'
|
||||
# fi
|
||||
echo $(jq -n --arg wifi "${is_wireless}" --arg wired "${is_ethernet}" --arg proton "${is_proton}" --arg proton_sc "${is_proton_sc}" --arg homevpn "${is_homevpn}" --arg homevpn_full "${is_homevpn_full}" '{wifi: $wifi, wired: $wired, proton: $proton, proton_sc: $proton_sc, homevpn: $homevpn, homevpn_full: $homevpn_full}')
|
||||
}
|
||||
|
||||
ifstatus
|
||||
|
|
Loading…
Add table
Reference in a new issue