sb-syncthing: new script
This commit is contained in:
parent
d91c813527
commit
97c9cef125
1 changed files with 15 additions and 0 deletions
15
common/.local/libexec/statusbar/sb-syncthing
Executable file
15
common/.local/libexec/statusbar/sb-syncthing
Executable file
|
@ -0,0 +1,15 @@
|
||||||
|
#!/bin/sh
|
||||||
|
. libsb
|
||||||
|
|
||||||
|
connections=$(syncthing cli show connections | jq '.connections')
|
||||||
|
|
||||||
|
count=$(echo "$connections" | jq 'length')
|
||||||
|
connected=$(echo "$connections" | jq 'map(select(.connected)) | length')
|
||||||
|
|
||||||
|
if [ "$connected" -le 0 ]; then
|
||||||
|
color=$fgred
|
||||||
|
else
|
||||||
|
color=$fggreen
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "<span ${color}> </span>${connected}/${count}"
|
Loading…
Add table
Add a link
Reference in a new issue