dwmblocks/scripts/dwmblocks-network

16 lines
574 B
Plaintext
Raw Normal View History

2023-02-21 12:15:57 -08:00
#!/usr/bin/env zsh
if [[ "$(uname)" = 'Linux' ]]; then
local active_networks="$(nmcli c s --active)"
local output=''
2023-05-04 15:04:51 -07:00
[[ "${active_networks}" = *' wifi '* ]] && output="${output}󰖩 "
[[ "${active_networks}" = *' ethernet '* ]] && output="${output}󰈁"
[[ "${active_networks}" = *' wireguard '* ]] && output="${output}󰖂 "
(( ${#output} == 0 )) && output='󰈂'
2023-09-09 20:31:16 -07:00
bluetoothctl show | grep 'Powered: yes' >/dev/null && output="${output}  "
2023-02-21 12:15:57 -08:00
printf '%s\n' "${output}"
else
echo "${0}: error: unknown os: \"$(uname)\"" >&2
exit 1
fi