Compare commits

..

2 Commits

Author SHA1 Message Date
Zander671 f763fc1188 Merge branch 'main' of git.zander.im:Zander671/random-scripts 2025-06-13 22:34:22 +09:00
Zander671 42ea5f1370 Update eww-network 2025-06-13 22:33:27 +09:00
+4 -4
View File
@@ -1,11 +1,11 @@
#!/usr/bin/env zsh #!/usr/bin/env zsh
if [[ "$(uname)" = 'Linux' ]]; then if [[ "$(uname)" = 'Linux' ]]; then
local active_networks="$(nmcli c s --active)" local active_networks="$(nmcli --fields type c s --active)"
local output='' local output=''
[[ "${active_networks}" = *' wifi '* ]] && output="${output}󰖩 " [[ "${active_networks}" = *'wifi'* ]] && output="${output}󰖩 "
[[ "${active_networks}" = *' ethernet '* ]] && output="${output}󰈁" [[ "${active_networks}" = *'ethernet'* ]] && output="${output}󰈁"
[[ "${active_networks}" = *' wireguard '* ]] && output="${output}󰖂 " [[ "${active_networks}" = *'wireguard'* ]] && output="${output}󰖂 "
(( ${#output} == 0 )) && output='󰈂' (( ${#output} == 0 )) && output='󰈂'
bluetoothctl show | grep 'Powered: yes' >/dev/null && output="${output}  " bluetoothctl show | grep 'Powered: yes' >/dev/null && output="${output}  "
printf '%s\n' "${output}" printf '%s\n' "${output}"