1
0
Fork 0
dotfiles/.local/libexec/cron/checkup

17 lines
565 B
Plaintext
Raw Normal View History

2022-07-04 21:36:33 +02:00
#!/bin/sh
2024-07-24 19:16:58 +02:00
pkill -RTMIN+1 dwmblocks
2024-04-16 12:04:36 +02:00
2023-02-20 12:23:39 +01:00
askupgrade() {
2024-07-20 15:06:11 +02:00
[ "$(notify-send -c updates --action=Yes=Yes --action=No=No " Repository Sync" "Updates available. Update now?")" = 'Yes' ] && $TERMCMD upgrades
2023-02-20 12:23:39 +01:00
}
2022-07-04 21:36:33 +02:00
2024-04-23 09:48:05 +02:00
\xbps-install -SMun 1>/tmp/xbps_updates 2>/tmp/xbps_errors
2024-01-09 10:29:28 +01:00
ne="$(grep -c broken /tmp/xbps_errors)"
n="$(grep -c -e update -e install /tmp/xbps_updates)"
if [ "$n" != "0" ] && [ "$ne" != "0" ]; then
notify-send -u critical "Error downloading updates." "$(cut -d " " -f 1,5 /tmp/xbps_errors)"
elif [ "$n" -gt 1 ] && [ "$ne" = "0" ]; then
askupgrade
2022-07-04 21:36:33 +02:00
fi