From 290075c1c77c7a936e247f6ee0c1f07c9464eea4 Mon Sep 17 00:00:00 2001 From: ER Date: Sun, 13 Aug 2023 17:14:39 +0300 Subject: [PATCH] feat: yafti module --- modules/yafti/yafti.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/yafti/yafti.sh b/modules/yafti/yafti.sh index e74eaea..b62343d 100644 --- a/modules/yafti/yafti.sh +++ b/modules/yafti/yafti.sh @@ -3,4 +3,16 @@ # Tell build process to exit if there are any errors. set -oue pipefail -echo "$1" \ No newline at end of file +YAFTI_FILE="/usr/share/ublue-os/firstboot/yafti.yml" + +get_yaml_array FLATPAKS '.custom-flatpaks[]' "$1" +if [[ ${#FLATPAKS[@]} -gt 0 ]]; then + echo "Adding Flatpaks to yafti.yml" + yq -i '.screens.applications.values.groups.Custom.description = "Flatpaks suggested by the image maintainer."' "${YAFTI_FILE}" + yq -i '.screens.applications.values.groups.Custom.default = true' "${YAFTI_FILE}" + + for pkg in "${FLATPAKS[@]}"; do + echo "Adding to yafti: ${pkg}" + yq -i ".screens.applications.values.groups.Custom.packages += [$pkg]" "${YAFTI_FILE}" + done +fi \ No newline at end of file