1
0
mirror of https://github.com/dcarrillo/dotfiles.git synced 2025-07-02 06:19:25 +00:00

[polybar] Add Syncthing status and improve output icon sizes

This commit is contained in:
2024-06-15 21:21:20 +02:00
parent 42647db6d2
commit 960573ae4e
9 changed files with 49 additions and 19 deletions

View File

@ -1,11 +1,15 @@
#!/usr/bin/env bash
OUTPUT=""
openvpn_icon="%{T2}%{T-}"
globalprotect_icon="%{T2}%{T-}"
openvpn=$(pgrep -c openvpn$)
[ "$openvpn" -gt 0 ] && OUTPUT=$(eval printf "%.0s" "{1..$openvpn}")
output=""
if pgrep openvpn >/dev/null; then
output=${openvpn_icon}
fi
globalprotect=$(pgrep -c gpclient$)
[ "$globalprotect" -gt 0 ] && OUTPUT=${OUTPUT}$(eval printf '%.0s' "{1..$globalprotect}")
if pgrep gpclient >/dev/null; then
output="${output} ${globalprotect_icon}"
fi
echo "$OUTPUT" | sed -e 's/\(.\)/\1 /g'
echo "$output"