Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae33917e8a
|
||
|
|
eabaa962dc
|
||
|
|
3f2702eb71
|
||
|
|
9f5c3b1cb4
|
||
|
|
961ddc1e72
|
||
|
|
ae43e401a5
|
@@ -3,7 +3,7 @@
|
||||
# Maintainer: Daniele Fucini <dfucini [at] gmail [dot] com>
|
||||
|
||||
pkgname=update-notify
|
||||
pkgver=2.0
|
||||
pkgver=3.0.2
|
||||
pkgrel=1
|
||||
pkgdesc='Notify when updates are available'
|
||||
arch=('any')
|
||||
@@ -15,7 +15,7 @@ makedepends=('git')
|
||||
optdepends=('git-monitor: to check git repos for updates')
|
||||
source=(git+${url}?signed#tag=${pkgver})
|
||||
validpgpkeys=('7E12BC1FF3B6EDB2CD8053EB981A2B2A3BBF5514')
|
||||
sha256sums=('e96dbcc2b77750be03d89cdf3e1351c20c9079b7de1e129da0188dd3b30f6a03')
|
||||
sha256sums=('3541f7b27a48316ba6cf7acb243cb50ae024ff139a39837ab78cb0ec9007efcd')
|
||||
|
||||
package()
|
||||
{
|
||||
|
||||
Regular → Executable
+23
-13
@@ -12,7 +12,7 @@ declare -A KERNELS=(
|
||||
[linux-lts]="linux-lts-custom"
|
||||
[linux-zen]="linux-zen-custom"
|
||||
)
|
||||
state_dir="${XDG_STATE_HOME:-$HOME/.local/state}/check-updates"
|
||||
state_dir="${XDG_STATE_HOME:-$HOME/.local/state}/update-notify"
|
||||
|
||||
[[ $threshold =~ ^[0-9]+$ ]] || { echo "Threshold must be a number" >&2; exit 1; }
|
||||
mkdir -p "$state_dir"
|
||||
@@ -98,20 +98,30 @@ done
|
||||
# General updates threshold
|
||||
# ---------------------------------------------------------------------------
|
||||
if (( updates >= threshold )); then
|
||||
notify_once "updates" "Updates available" "Arch: $arch_updates, AUR: $aur_updates"
|
||||
reminders=()
|
||||
|
||||
hints=(
|
||||
"git-monitor|Check git packages|Use git-monitor for git packages updates"
|
||||
"fwupdmgr|Check firmware|Use fwupdmgr to check for firmware updates"
|
||||
)
|
||||
for hint in "${hints[@]}"; do
|
||||
IFS='|' read -r cmd title body <<< "$hint"
|
||||
if command -v "$cmd" >/dev/null 2>&1; then
|
||||
notify_once "hint-$cmd" "$title" "$body"
|
||||
# Always remind about git packages if git-monitor is installed
|
||||
if command -v git-monitor >/dev/null 2>&1; then
|
||||
reminders+=("git-monitor")
|
||||
fi
|
||||
done
|
||||
|
||||
# Firmware: only mention it when updates actually exist.
|
||||
# fwupdmgr get-updates exits 0 when updates are available, 2 when there are none.
|
||||
# --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
|
||||
|
||||
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
|
||||
clear_state "updates"
|
||||
clear_state "hint-git-monitor"
|
||||
clear_state "hint-fwupdmgr"
|
||||
fi
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ Description=Run update-notify every 6 hours
|
||||
|
||||
[Timer]
|
||||
OnBootSec=5min
|
||||
OnUnitActiveSec=12h
|
||||
OnUnitActiveSec=6h
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
|
||||
Reference in New Issue
Block a user