1 2 3 4 5
#!/bin/sh output="$(mbsync -a | grep -E 'pulled [1-9]' | sed -E 's/ and [0-9]+ flag.*//')" [ -n "$output" ] && notify-send "mbsync" "$output" exit 0