2018-11-30 22:00:19 +01:00
|
|
|
#!/bin/bash
|
2017-11-22 01:27:01 +01:00
|
|
|
|
2018-11-30 22:00:19 +01:00
|
|
|
if [[ -f /dev/shm/claws_offline ]]
|
2018-03-06 14:47:28 +01:00
|
|
|
then
|
2019-06-13 20:12:29 +02:00
|
|
|
echo "<span foreground=\"#F2777A\">■</span>"
|
2018-03-06 14:47:28 +01:00
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2018-11-30 22:00:19 +01:00
|
|
|
if [[ ! -f /dev/shm/updates ]]
|
2018-06-02 00:09:39 +02:00
|
|
|
then
|
|
|
|
echo 0 > /dev/shm/updates
|
|
|
|
fi
|
|
|
|
|
2018-11-30 22:00:19 +01:00
|
|
|
avail=($(checkupdates | cut -d' ' -f1))
|
|
|
|
aur=($(yaourt -Qua | cut -d' ' -f1 | grep 'aur/'))
|
|
|
|
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
|
2019-06-13 20:12:29 +02:00
|
|
|
echo "<span foreground=\"#99CC99\">■</span>"
|
2017-11-22 01:27:01 +01:00
|
|
|
else
|
2019-06-13 20:12:29 +02:00
|
|
|
echo "<span foreground=\"#FFCC66\">■</span>"
|
2018-11-30 22:00:19 +01:00
|
|
|
if [[ $(cat /dev/shm/updates) -ne $total ]] || [[ -n "$BLOCK_BUTTON" ]]
|
2018-06-02 00:09:39 +02:00
|
|
|
then
|
2019-04-19 22:18:25 +02:00
|
|
|
[[ $total -eq 1 ]] && notify-send "1 mise à jour disponible" "$(for item in ${avail[@]} ${aur[@]}; do echo -n $item; done)"
|
|
|
|
[[ $total -gt 1 ]] && notify-send "$total mises à jour disponibles" "$(for item in ${avail[@]} ${aur[@]}; do echo -n "$item, "; done | sed 's/, $//g')"
|
2018-06-02 00:09:39 +02:00
|
|
|
fi
|
2017-11-22 01:27:01 +01:00
|
|
|
fi
|
2018-06-02 00:09:39 +02:00
|
|
|
|
|
|
|
echo $total > /dev/shm/updates
|