feat(default-flatpaks): Add info about which flatpaks are installed (#85)

* feat(default-flatpaks): Add info about which flatpaks are installed & uninstalled in notification. Also implement notification enable/disable config support.

* feat(default-flatpaks): Add support for configuring notifications in recipe file

* fix(default-flatpaks): Formatting fixes

* fix(default-flatpaks): Fix "enabling" typo instead of "configuring" notifications

* chore(default-flatpaks): Remove unused yq command

* fix(default-flatpaks): There is no need for 2 double quotes
This commit is contained in:
fiftydinar 2023-12-21 21:34:33 +01:00 committed by GitHub
parent 623834bb3b
commit bd92e7e5c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 6 deletions

View file

@ -18,10 +18,13 @@ The scripts are run on every boot by these services:
This module stores the Flatpak remote configuration and Flatpak install/remove lists in `/etc/flatpak/`. There are two subdirectories, `user` and `system` corresponding with the install level of the Flatpaks and repositories. Each directory has text files containing the IDs of flatpaks to `install` and `remove`, plus a `repo-info.yml` containing the details of the Flatpak repository.
This module also supports disabling & enabling notifications.
## Example configurations
```yaml
type: default-flatpaks
notify: true # Send notification after install/uninstall is finished (true/false)
system:
# If no repo information is specified, Flathub will be used by default
repo-url: https://dl.flathub.org/repo/flathub.flatpakrepo

View file

@ -118,3 +118,8 @@ if [[ ! $(echo "$1" | yq -I=0 ".user") == "null" ]]; then
configure_flatpak_repo "$1" "user"
configure_lists "$1" "user"
fi
echo "Configuring default-flatpaks notifications"
NOTIFICATIONS=$(yq ".notify" "$CONFIG_FILE")
NOTIFICATIONS_CONFIG_FILE="/usr/etc/flatpak/notifications"
echo "$NOTIFICATIONS" > "$NOTIFICATIONS_CONFIG_FILE"