1
0
mirror of https://github.com/dcarrillo/dotfiles.git synced 2024-11-15 06:51:12 +00:00
dotfiles/.config/polybar/scripts/syncthing_status

20 lines
438 B
Plaintext
Raw Normal View History

#!/usr/bin/env bash
output=""
while IFS="[ .]" read -r connected paused; do
if [ "$paused" == "true" ]; then
output="${output} "
continue
fi
if [ "$connected" == "false" ]; then
output="${output}󰅤 "
else
output="${output} "
fi
done <<-EOF
$(syncthing cli show connections | jq -r '.connections[] | "\(.connected) \(.paused)"')
EOF
printf "%s" "%{T2}${output%?}%{T-}"