dwmblocks-network 574 B

12345678910111213141516
  1. #!/usr/bin/env zsh
  2. if [[ "$(uname)" = 'Linux' ]]; then
  3. local active_networks="$(nmcli c s --active)"
  4. local output=''
  5. [[ "${active_networks}" = *' wifi '* ]] && output="${output}󰖩 "
  6. [[ "${active_networks}" = *' ethernet '* ]] && output="${output}󰈁"
  7. [[ "${active_networks}" = *' wireguard '* ]] && output="${output}󰖂 "
  8. (( ${#output} == 0 )) && output='󰈂'
  9. bluetoothctl show | grep 'Powered: yes' >/dev/null && output="${output}  "
  10. printf '%s\n' "${output}"
  11. else
  12. echo "${0}: error: unknown os: \"$(uname)\"" >&2
  13. exit 1
  14. fi