Files
random-scripts/eww/eww-network
T

16 lines
582 B
Bash
Raw Normal View History

2024-04-28 23:26:31 -07:00
#!/usr/bin/env zsh
if [[ "$(uname)" = 'Linux' ]]; then
2025-06-13 22:33:27 +09:00
local active_networks="$(nmcli --fields type c s --active)"
2024-04-28 23:26:31 -07:00
local output=''
2025-06-13 22:33:27 +09:00
[[ "${active_networks}" = *'wifi'* ]] && output="${output}󰖩 "
[[ "${active_networks}" = *'ethernet'* ]] && output="${output}󰈁"
[[ "${active_networks}" = *'wireguard'* ]] && output="${output}󰖂 "
2024-04-28 23:26:31 -07:00
(( ${#output} == 0 )) && output='󰈂'
bluetoothctl show | grep 'Powered: yes' >/dev/null && output="${output}  "
printf '%s\n' "${output}"
else
echo "${0}: error: unknown os: \"$(uname)\"" >&2
exit 1
fi