Update for waybar
This commit is contained in:
@ -1,5 +1,10 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
let bluetooth=1
|
||||
if [[ "${1}" == '--no-bluetooth' ]] || [[ "${1}" == '-n' ]]; then
|
||||
bluetooth=0
|
||||
fi
|
||||
|
||||
if [[ "$(uname)" = 'Linux' ]]; then
|
||||
local active_networks="$(nmcli --fields type c s --active)"
|
||||
local output=''
|
||||
@ -7,7 +12,9 @@ if [[ "$(uname)" = 'Linux' ]]; then
|
||||
[[ "${active_networks}" = *'ethernet'* ]] && output="${output}"
|
||||
[[ "${active_networks}" = *'wireguard'* ]] && output="${output} "
|
||||
(( ${#output} == 0 )) && output=''
|
||||
bluetoothctl show | grep 'Powered: yes' >/dev/null && output="${output} "
|
||||
if (( bluetooth )); then
|
||||
bluetoothctl show | grep 'Powered: yes' >/dev/null && output="${output} "
|
||||
fi
|
||||
printf '%s\n' "${output}"
|
||||
else
|
||||
echo "${0}: error: unknown os: \"$(uname)\"" >&2
|
||||
|
Reference in New Issue
Block a user