Another copy of my dotfiles. Because I don't completely trust GitHub.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
515 B

  1. #!/bin/sh
  2. ETH_IT=enp2s0
  3. WLAN_IT=wlp3s0
  4. is_eth_used=$(cat /sys/class/net/${ETH_IT}/carrier)
  5. is_wlan_used=$(cat /sys/class/net/${WLAN_IT}/carrier)
  6. echo -n "^c#88c0d0^"
  7. if [ "$is_eth_used" -eq 1 ]; then # wired network is carrying
  8. icon="^d^ " #uF6FF
  9. elif [ "$is_wlan_used" -eq 1 ]; then # wireless network is carrying
  10. icon="直 ^d^ $(nmcli -t -f active,ssid dev wifi | egrep '^yes' | cut -d\' -f2 | cut -d ':' -f2)" #uF1EB
  11. else
  12. icon="^d^" #uf128 # no network
  13. fi
  14. echo -n $icon