diff --git a/de/home/.config/eww/modules/bar/vpn.yuck b/de/home/.config/eww/modules/bar/vpn.yuck index 4aae6ad..b67315d 100644 --- a/de/home/.config/eww/modules/bar/vpn.yuck +++ b/de/home/.config/eww/modules/bar/vpn.yuck @@ -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 ? "󰇧 " : "󰇧 "}))) diff --git a/de/home/.config/eww/scripts/bar/networking b/de/home/.config/eww/scripts/bar/networking index a19400d..f93caa4 100755 --- a/de/home/.config/eww/scripts/bar/networking +++ b/de/home/.config/eww/scripts/bar/networking @@ -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