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

20 lines
438 B
Bash
Executable File

#!/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-}"