Add xmobar-sync-status

885815f6a507bc625ecbc16d76527f10bc991eb1
Alexis Sellier committed ago 1 parent 39b7bfb7
bin/xmobar-sync-status added +23 -0
1 +
#!/bin/sh
2 +
3 +
REMOTE=share
4 +
5 +
while :; do
6 +
  status="$(systemctl --user is-active share-sync)"
7 +
8 +
  case "$status" in
9 +
    "active")
10 +
      ping -c1 -w5 $REMOTE 2>&1 >/dev/null
11 +
12 +
      if [[ $? -eq 0 ]]; then
13 +
        echo "<fc=aquamarine>✔</fc>"
14 +
      else
15 +
        echo "<fc=maroon>!</fc>"
16 +
      fi ;;
17 +
18 +
    *)
19 +
      echo "<fc=maroon>✘</fc>" ;;
20 +
  esac
21 +
22 +
  sleep 5
23 +
done