diff --git a/de/home/.config/eww/scripts/bar/networking b/de/home/.config/eww/scripts/bar/networking index f93caa4..83cdfe7 100755 --- a/de/home/.config/eww/scripts/bar/networking +++ b/de/home/.config/eww/scripts/bar/networking @@ -2,8 +2,10 @@ function ifstatus(){ + is_online=false is_wireless=false is_ethernet=false + is_vpn=false is_proton=false is_proton_sc=false is_homevpn=false @@ -18,11 +20,20 @@ function ifstatus(){ vpn_cons=$(nmcli -g TYPE,NAME connection show --active | grep -e "vpn" -e "wireguard") case ${vpn_cons} in - *ProtonVPN) + *ProtonVPN|*'ProtonVPN\n') is_proton='true' - ;; - *ProtonVPN-SC) + ;;& + *ProtonVPN-SC|*'ProtonVPN-SC\n') is_proton_sc='true' + ;;& + *HomeVPN) + is_homevpn='true' + ;;& + *HomeVPN-Full) + is_homevpn_full='true' + ;;& + *ProtonVPN|*ProtonVPN-SC|*HomeVPN|*HomeVPN-Full) + is_vpn='true' ;; esac # if grep -qe "ProtonVPN$" <<<${vpn_cons};then @@ -37,7 +48,7 @@ function ifstatus(){ # 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}') + echo $(jq -n --arg online "${is_online}" --arg wifi "${is_wireless}" --arg wired "${is_ethernet}" --arg vpn "${is_vpn}" --arg proton "${is_proton}" --arg proton_sc "${is_proton_sc}" --arg homevpn "${is_homevpn}" --arg homevpn_full "${is_homevpn_full}" '{online: $online, wifi: $wifi, wired: $wired, vpn: $vpn, proton: $proton, proton_sc: $proton_sc, homevpn: $homevpn, homevpn_full: $homevpn_full}') } ifstatus