2018-11-26 19:17:18 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# Syncs repositories and downloads updates, meant to be run as a cronjob.
|
|
|
|
|
|
|
|
ping -q -w 1 -c 1 `ip r | grep -m 1 default | cut -d ' ' -f 3` >/dev/null || exit
|
|
|
|
|
2019-01-18 18:21:25 +00:00
|
|
|
notify-send -i "$PIX/larbs.svg" "Checking for pacakge updates..."
|
2018-11-26 19:17:18 +00:00
|
|
|
|
2019-01-04 01:39:10 +00:00
|
|
|
sudo pacman -Syyuw --noconfirm || notify-send "Error downloading updates.
|
2018-11-26 19:17:18 +00:00
|
|
|
|
|
|
|
Check your internet connection, if pacman is already running, or run update manually to see errors."
|
|
|
|
pkill -RTMIN+8 i3blocks
|
|
|
|
|
2019-01-05 04:08:49 +00:00
|
|
|
if pacman -Qu | grep -v "\[ignored\]"
|
2018-11-26 19:17:18 +00:00
|
|
|
then
|
2019-01-04 01:39:10 +00:00
|
|
|
notify-send -i "$PIX/larbs.gif" "Package updates available. Click statusbar icon (📦) for update."
|
2018-11-26 19:17:18 +00:00
|
|
|
else
|
2019-01-04 01:39:10 +00:00
|
|
|
notify-send -i "$PIX/larbs.gif" "Repository sync complete. No new packages for update."
|
2018-11-26 19:17:18 +00:00
|
|
|
fi
|