Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae33917e8a
|
||
|
|
eabaa962dc
|
||
|
|
3f2702eb71
|
||
|
|
9f5c3b1cb4
|
@@ -3,7 +3,7 @@
|
|||||||
# Maintainer: Daniele Fucini <dfucini [at] gmail [dot] com>
|
# Maintainer: Daniele Fucini <dfucini [at] gmail [dot] com>
|
||||||
|
|
||||||
pkgname=update-notify
|
pkgname=update-notify
|
||||||
pkgver=3.0
|
pkgver=3.0.2
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc='Notify when updates are available'
|
pkgdesc='Notify when updates are available'
|
||||||
arch=('any')
|
arch=('any')
|
||||||
@@ -15,7 +15,7 @@ makedepends=('git')
|
|||||||
optdepends=('git-monitor: to check git repos for updates')
|
optdepends=('git-monitor: to check git repos for updates')
|
||||||
source=(git+${url}?signed#tag=${pkgver})
|
source=(git+${url}?signed#tag=${pkgver})
|
||||||
validpgpkeys=('7E12BC1FF3B6EDB2CD8053EB981A2B2A3BBF5514')
|
validpgpkeys=('7E12BC1FF3B6EDB2CD8053EB981A2B2A3BBF5514')
|
||||||
sha256sums=('47f8d1aac3ef6cdb19b4f72c5b3d5cf45433810fbd166038525336c1e3cf83fc')
|
sha256sums=('3541f7b27a48316ba6cf7acb243cb50ae024ff139a39837ab78cb0ec9007efcd')
|
||||||
|
|
||||||
package()
|
package()
|
||||||
{
|
{
|
||||||
|
|||||||
+22
-12
@@ -98,20 +98,30 @@ done
|
|||||||
# General updates threshold
|
# General updates threshold
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
if (( updates >= threshold )); then
|
if (( updates >= threshold )); then
|
||||||
notify_once "updates" "Updates available" "Arch: $arch_updates, AUR: $aur_updates"
|
reminders=()
|
||||||
|
|
||||||
hints=(
|
# Always remind about git packages if git-monitor is installed
|
||||||
"git-monitor|Check git packages|Use git-monitor for git packages updates"
|
if command -v git-monitor >/dev/null 2>&1; then
|
||||||
"fwupdmgr|Check firmware|Use fwupdmgr to check for firmware updates"
|
reminders+=("git-monitor")
|
||||||
)
|
fi
|
||||||
for hint in "${hints[@]}"; do
|
|
||||||
IFS='|' read -r cmd title body <<< "$hint"
|
# Firmware: only mention it when updates actually exist.
|
||||||
if command -v "$cmd" >/dev/null 2>&1; then
|
# fwupdmgr get-updates exits 0 when updates are available, 2 when there are none.
|
||||||
notify_once "hint-$cmd" "$title" "$body"
|
# --no-metadata-check avoids prompting/refreshing; the fwupd-refresh timer keeps metadata fresh.
|
||||||
|
if command -v fwupdmgr >/dev/null 2>&1; then
|
||||||
|
timeout 30 fwupdmgr get-updates --no-metadata-check </dev/null >/dev/null 2>&1
|
||||||
|
if (( $? == 0 )); then
|
||||||
|
reminders+=("fwupdmgr (firmware updates available)")
|
||||||
fi
|
fi
|
||||||
done
|
fi
|
||||||
|
|
||||||
|
body="Arch: $arch_updates, AUR: $aur_updates"
|
||||||
|
if (( ${#reminders[@]} )); then
|
||||||
|
printf -v list '%s, ' "${reminders[@]}"
|
||||||
|
body+=$'\n'"Also check: ${list%, }"
|
||||||
|
fi
|
||||||
|
|
||||||
|
notify_once "updates" "Updates available" "$body"
|
||||||
else
|
else
|
||||||
clear_state "updates"
|
clear_state "updates"
|
||||||
clear_state "hint-git-monitor"
|
|
||||||
clear_state "hint-fwupdmgr"
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@ Description=Run update-notify every 6 hours
|
|||||||
|
|
||||||
[Timer]
|
[Timer]
|
||||||
OnBootSec=5min
|
OnBootSec=5min
|
||||||
OnUnitActiveSec=12h
|
OnUnitActiveSec=6h
|
||||||
Persistent=true
|
Persistent=true
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|||||||
Reference in New Issue
Block a user