2017-11-22 01:27:01 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2018-03-06 14:47:28 +01:00
|
|
|
if [ -f /dev/shm/claws_offline ]
|
|
|
|
then
|
|
|
|
echo "<span foreground=\"#F2777A\">█</span>"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2018-06-02 00:09:39 +02:00
|
|
|
if [ ! -f /dev/shm/updates ]
|
|
|
|
then
|
|
|
|
echo 0 > /dev/shm/updates
|
|
|
|
fi
|
|
|
|
|
2018-03-06 14:47:28 +01:00
|
|
|
avail=$(checkupdates | wc -l)
|
2018-03-27 17:38:03 +02:00
|
|
|
aur=$(yaourt -Qua | grep 'aur/' | wc -l)
|
2018-06-02 00:09:39 +02:00
|
|
|
total=$(($avail + $aur))
|
2017-11-22 01:27:01 +01:00
|
|
|
|
2018-06-02 00:09:39 +02:00
|
|
|
if [[ $total -eq 0 ]]
|
2017-11-22 01:27:01 +01:00
|
|
|
then
|
2018-03-06 14:47:28 +01:00
|
|
|
echo "<span foreground=\"#99CC99\">█</span>"
|
2017-11-22 01:27:01 +01:00
|
|
|
else
|
2018-03-27 17:38:03 +02:00
|
|
|
echo "<span foreground=\"#FFCC66\">█</span>"
|
2018-06-02 00:09:39 +02:00
|
|
|
if [[ $(cat /dev/shm/updates) -ne $total ]]
|
|
|
|
then
|
|
|
|
[[ $total -eq 1 ]] && notify-send "Mise à jour disponible" "1 màj disponible"
|
|
|
|
[[ $total -gt 1 ]] && notify-send "Mises à jour disponibles" "$total màj disponibles"
|
|
|
|
fi
|
2017-11-22 01:27:01 +01:00
|
|
|
fi
|
2018-06-02 00:09:39 +02:00
|
|
|
|
|
|
|
echo $total > /dev/shm/updates
|