Update for waybar

This commit is contained in:
2025-10-09 22:40:38 -07:00
parent d7fbed68bf
commit 5b551a4075
5 changed files with 31 additions and 7 deletions

View File

@ -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