OSDN Git Service

allow disabling update notifier
authorpaperbenni <paperbenni@gmail.com>
Mon, 3 Aug 2020 21:15:44 +0000 (23:15 +0200)
committerpaperbenni <paperbenni@gmail.com>
Mon, 3 Aug 2020 21:15:44 +0000 (23:15 +0200)
autostart.sh
programs/instantupdatenotify

index a66ad9e..3d609bf 100755 (executable)
@@ -391,3 +391,21 @@ fi
 if [ -e ~/.instantautostart ]; then
        bash ~/.instantautostart &
 fi
+
+# update notifier
+if ! iconf -i noupdates; then
+       sleep 2m
+       if checkinternet; then
+               instantupdatenotify
+       else
+               if command -v checkinternet; then
+                       while :; do
+                               sleep 5m
+                               if checkinternet; then
+                                       instantupdatenotify
+                                       break
+                               fi
+                       done
+               fi
+       fi
+fi
index ee52e15..7f2eafc 100644 (file)
@@ -2,6 +2,11 @@
 
 # check for updates and add a little notification to the top offering to install them
 
+if ! command -v pacman; then
+       echo "not on an arch system"
+       exit
+fi
+
 UPDATECOUNT="$(checkupdates | wc -l)"
 
 if ! [ "$UPDATECOUNT" -gt 1 ]; then