1
0
mirror of https://github.com/dcarrillo/dotfiles.git synced 2024-11-20 17:41:13 +00:00
dotfiles/.config/polybar/scripts/syncthing_status

20 lines
438 B
Plaintext
Raw Permalink 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-}"