Read settings from a config file
Source ~/.config/update-notify/config to override THRESHOLD, AUR_REPO and KERNELS, so settings survive package upgrades. The threshold argument still takes precedence, so drop it from the service. Add a commented sample config.
This commit is contained in:
@@ -48,28 +48,22 @@ The timer runs 5 minutes after boot, then every 6 hours.
|
||||
update-notify [threshold]
|
||||
```
|
||||
|
||||
`threshold` is the minimum number of updates (repo + AUR) before update counts are shown. The default is 30.
|
||||
|
||||
To change the threshold used by the timer, override the service:
|
||||
|
||||
```
|
||||
systemctl --user edit update-notify.service
|
||||
```
|
||||
|
||||
```ini
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=/usr/bin/update-notify 50
|
||||
```
|
||||
`threshold` is the minimum number of updates (repo + AUR) before update counts are shown. It overrides the `THRESHOLD` setting below.
|
||||
|
||||
## Configuration
|
||||
|
||||
These settings are at the top of the script:
|
||||
Settings are read from `$XDG_CONFIG_HOME/update-notify/config` (default `~/.config/update-notify/config`), a bash file that is sourced by the script. All settings are optional:
|
||||
|
||||
- `THRESHOLD`: minimum number of updates before update counts are shown (default 30).
|
||||
- `AUR_REPO`: name of the local aurutils repository (default `aur-local`).
|
||||
- `KERNELS`: maps each stock kernel package to its custom build. Kernels where either package isn't installed are skipped.
|
||||
- `KERNELS`: maps each stock kernel package to its custom build (default: `linux`, `linux-lts` and `linux-zen` to `<name>-custom`). Kernels where either package isn't installed are skipped. Set `KERNELS=()` to disable the kernel check.
|
||||
|
||||
Changes to the installed script are overwritten on upgrade, so change them in the source and rebuild the package.
|
||||
A commented sample config is installed with the package. To start from it:
|
||||
|
||||
```
|
||||
mkdir -p ~/.config/update-notify
|
||||
cp /usr/share/doc/update-notify/config.example ~/.config/update-notify/config
|
||||
```
|
||||
|
||||
Kernel versions are compared without `pkgrel`, so a stock packaging-only update doesn't trigger a rebuild reminder. A custom build already in the local repository but not installed yet counts as up to date.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user