diff --git a/modules/default-flatpaks/README.md b/modules/default-flatpaks/README.md index a08e77d..bad154d 100644 --- a/modules/default-flatpaks/README.md +++ b/modules/default-flatpaks/README.md @@ -2,7 +2,7 @@ The `default-flatpaks` module can be used to install or uninstall Flatpaks from a configurable remote on every boot. It skips that operation if no changes are detected. This module first removes the Fedora Flatpaks remote and Flatpaks that come pre-installed in Fedora. A Flatpak remote is configured the first time the module is used, but it can be re-configured in subsequent usages of the module. If no Flatpak remote is specified, the module will default to using Flathub. -Flatpaks can either be installed system-wide or per-user. Per-user Flatpaks will be installed separetly for every user on a system. Previously-installed flatpaks can also be removed. +Flatpaks can either be installed system-wide or per-user. Per-user Flatpaks will be installed separately for every user on a system. Previously-installed flatpaks can also be removed. The module uses the following scripts to handle flatpak setup: @@ -14,8 +14,16 @@ The scripts are run on every boot by these services: - `/usr/lib/systemd/system/system-flatpak-setup.service` - `/usr/lib/systemd/user/user-flatpak-setup-service` -`system-flatpak-setup` uninstalls Fedora flatpaks, replaces Fedora repos with your repo choice, checks the Flatpak install/remove lists created by the module & performs the install/uninstall operation according to that. `user-flatpak-setup` does the same things for user Flatpaks. +`system-flatpak-setup` uninstalls Fedora flatpaks, replaces Fedora repos with your repo choice, checks the Flatpak install/remove lists created by the module & performs the install/uninstall operation according to that. `user-flatpak-setup` does the same thing for user Flatpaks. -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 stores the Flatpak remote configuration and Flatpak install/remove lists in `/usr/share/bluebuild/default-flatpaks/`. 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. \ No newline at end of file +This module also supports disabling & enabling notifications. + +## Local modification + +If a local user is not satisfied with default Flatpak installations and removals in the image, it is possible for them to make modifications to the default configuration through the configuration files located within this directory: + +`/etc/bluebuild/default-flatpaks/` + +Folder structure is the same as talked about above, with `system` & `user` folders, `install` & `remove` files containing explanation on how those should be modified & what they do. The `notifications` file also contains this explanation for turning notifications on or off. diff --git a/modules/default-flatpaks/config/notifications b/modules/default-flatpaks/config/notifications new file mode 100644 index 0000000..770dbe1 --- /dev/null +++ b/modules/default-flatpaks/config/notifications @@ -0,0 +1,3 @@ +# This file contains the image's default configuration for `notifications` used by the the `default-flatpaks` module. +# Possible values: true, false + diff --git a/modules/default-flatpaks/config/system/install b/modules/default-flatpaks/config/system/install new file mode 100644 index 0000000..d24344f --- /dev/null +++ b/modules/default-flatpaks/config/system/install @@ -0,0 +1,3 @@ +# This file contains the image's default configuration for `system flatpaks install` used by the `default-flatpaks` BlueBuild module. +# This list uses the Flatpak ID format, with one ID per line. + diff --git a/modules/default-flatpaks/config/system/remove b/modules/default-flatpaks/config/system/remove new file mode 100644 index 0000000..66e0629 --- /dev/null +++ b/modules/default-flatpaks/config/system/remove @@ -0,0 +1,3 @@ +# This file contains the image's default configuration for `system flatpaks removal` used by the `default-flatpaks` BlueBuild module. +# This list uses the Flatpak ID format, with one ID per line. + diff --git a/modules/default-flatpaks/config/user/install b/modules/default-flatpaks/config/user/install new file mode 100644 index 0000000..ee3d335 --- /dev/null +++ b/modules/default-flatpaks/config/user/install @@ -0,0 +1,3 @@ +# This file contains the image's default configuration for `user flatpaks install` used by the `default-flatpaks` BlueBuild module. +# This list uses the Flatpak ID format, with one ID per line. + diff --git a/modules/default-flatpaks/config/user/remove b/modules/default-flatpaks/config/user/remove new file mode 100644 index 0000000..85d3d82 --- /dev/null +++ b/modules/default-flatpaks/config/user/remove @@ -0,0 +1,3 @@ +# This file contains the image's default configuration for `user flatpaks removal` used by the `default-flatpaks` BlueBuild module. +# This list uses the Flatpak ID format, with one ID per line. + diff --git a/modules/default-flatpaks/default-flatpaks.sh b/modules/default-flatpaks/default-flatpaks.sh index f20455e..6564f65 100644 --- a/modules/default-flatpaks/default-flatpaks.sh +++ b/modules/default-flatpaks/default-flatpaks.sh @@ -13,7 +13,7 @@ cp -r "$MODULE_DIRECTORY"/default-flatpaks/user-flatpak-setup.service /usr/lib/s configure_flatpak_repo () { CONFIG_FILE=$1 INSTALL_LEVEL=$2 - REPO_INFO="/usr/etc/flatpak/$INSTALL_LEVEL/repo-info.yml" + REPO_INFO="/usr/share/bluebuild/default-flatpaks/$INSTALL_LEVEL/repo-info.yml" get_yaml_array INSTALL ".$INSTALL_LEVEL.install[]" "$CONFIG_FILE" @@ -78,14 +78,13 @@ EOF configure_lists () { CONFIG_FILE=$1 INSTALL_LEVEL=$2 - INSTALL_LIST="/usr/etc/flatpak/$INSTALL_LEVEL/install" - REMOVE_LIST="/usr/etc/flatpak/$INSTALL_LEVEL/remove" + INSTALL_LIST="/usr/share/bluebuild/default-flatpaks/$INSTALL_LEVEL/install" + REMOVE_LIST="/usr/share/bluebuild/default-flatpaks/$INSTALL_LEVEL/remove" get_yaml_array INSTALL ".$INSTALL_LEVEL.install[]" "$CONFIG_FILE" get_yaml_array REMOVE ".$INSTALL_LEVEL.remove[]" "$CONFIG_FILE" echo "Creating $INSTALL_LEVEL Flatpak install list at $INSTALL_LIST" if [[ ${#INSTALL[@]} -gt 0 ]]; then - touch $INSTALL_LIST for flatpak in "${INSTALL[@]}"; do echo "Adding to $INSTALL_LEVEL flatpak installs: $(printf ${flatpak})" echo $flatpak >> $INSTALL_LIST @@ -94,7 +93,6 @@ configure_lists () { echo "Creating $INSTALL_LEVEL Flatpak removals list $REMOVE_LIST" if [[ ${#REMOVE[@]} -gt 0 ]]; then - touch $REMOVE_LIST for flatpak in "${REMOVE[@]}"; do echo "Adding to $INSTALL_LEVEL flatpak removals: $(printf ${flatpak})" echo $flatpak >> $REMOVE_LIST @@ -103,23 +101,37 @@ configure_lists () { } echo "Enabling flatpaks module" -mkdir -p /usr/etc/flatpak/{system,user} +mkdir -p /usr/share/bluebuild/default-flatpaks/{system,user} +mkdir -p /usr/etc/bluebuild/default-flatpaks/{system,user} systemctl enable -f system-flatpak-setup.service systemctl enable -f --global user-flatpak-setup.service -# Check that `system` is present before configuring +# Check that `system` is present before configuring. Also copy template list files before writing Flatpak IDs. if [[ ! $(echo "$1" | yq -I=0 ".system") == "null" ]]; then configure_flatpak_repo "$1" "system" + cp -r "$MODULE_DIRECTORY"/default-flatpaks/config/system/install /usr/share/bluebuild/default-flatpaks/system/install + cp -r "$MODULE_DIRECTORY"/default-flatpaks/config/system/remove /usr/share/bluebuild/default-flatpaks/system/remove configure_lists "$1" "system" fi -# Check that `user` is present before configuring +# Check that `user` is present before configuring. Also copy template list files before writing Flatpak IDs. if [[ ! $(echo "$1" | yq -I=0 ".user") == "null" ]]; then configure_flatpak_repo "$1" "user" + cp -r "$MODULE_DIRECTORY"/default-flatpaks/config/user/install /usr/share/bluebuild/default-flatpaks/user/install + cp -r "$MODULE_DIRECTORY"/default-flatpaks/config/user/remove /usr/share/bluebuild/default-flatpaks/user/remove configure_lists "$1" "user" fi echo "Configuring default-flatpaks notifications" NOTIFICATIONS=$(echo "$1" | yq -I=0 ".notify") -NOTIFICATIONS_CONFIG_FILE="/usr/etc/flatpak/notifications" -echo "$NOTIFICATIONS" > "$NOTIFICATIONS_CONFIG_FILE" +CONFIG_NOTIFICATIONS="/usr/share/bluebuild/default-flatpaks/notifications" +cp -r "$MODULE_DIRECTORY"/default-flatpaks/config/notifications "$CONFIG_NOTIFICATIONS" +echo "$NOTIFICATIONS" >> "$CONFIG_NOTIFICATIONS" + +echo "Copying user modification template files" + +cp -r "$MODULE_DIRECTORY"/default-flatpaks/user-config/system/install /usr/etc/bluebuild/default-flatpaks/system/install +cp -r "$MODULE_DIRECTORY"/default-flatpaks/user-config/system/remove /usr/etc/bluebuild/default-flatpaks/system/remove +cp -r "$MODULE_DIRECTORY"/default-flatpaks/user-config/user/install /usr/etc/bluebuild/default-flatpaks/user/install +cp -r "$MODULE_DIRECTORY"/default-flatpaks/user-config/user/remove /usr/etc/bluebuild/default-flatpaks/user/remove +cp -r "$MODULE_DIRECTORY"/default-flatpaks/user-config/notifications /usr/etc/bluebuild/default-flatpaks/notifications diff --git a/modules/default-flatpaks/system-flatpak-setup b/modules/default-flatpaks/system-flatpak-setup index cc20624..2710eee 100755 --- a/modules/default-flatpaks/system-flatpak-setup +++ b/modules/default-flatpaks/system-flatpak-setup @@ -17,7 +17,7 @@ if grep -qz 'fedora' <<< "$(flatpak remotes)"; then flatpak remove --system --noninteractive ${FEDORA_FLATPAKS[@]} fi -REPO_INFO="/etc/flatpak/system/repo-info.yml" +REPO_INFO="/usr/share/bluebuild/default-flatpaks/system/repo-info.yml" REPO_URL=$(yq '.repo-url' $REPO_INFO) REPO_NAME=$(yq '.repo-name' $REPO_INFO) REPO_TITLE=$(yq '.repo-title' $REPO_INFO) @@ -42,14 +42,34 @@ if [[ ! $REPO_TITLE == "null" ]]; then fi # Notifications config -NOTIFICATIONS=$(cat /etc/flatpak/notifications) +NOTIFICATIONS_FILE="/usr/share/bluebuild/default-flatpaks/notifications" +USER_NOTIFICATIONS_FILE="/etc/bluebuild/default-flatpaks/notifications" +# Ignore words starting with # symbol, whitelines & duplicate entries for notifications config +MAINTAINER_NOTIFICATIONS=$(cat "$NOTIFICATIONS_FILE" | grep -v -E '^#|^$' | awk '!seen[$0]++') +USER_NOTIFICATIONS=$(cat "$USER_NOTIFICATIONS_FILE" | grep -v -E '^#|^$' | awk '!seen[$0]++') + +# If user modified notifications config, utilize user's configuration, otherwise maintainer's +if [[ -n $USER_NOTIFICATIONS ]]; then + NOTIFICATIONS="$USER_NOTIFICATIONS" +else + NOTIFICATIONS="$MAINTAINER_NOTIFICATIONS" +fi # Installed flatpaks FLATPAK_LIST=$(flatpak list --system --columns=application) # Flatpak list files -INSTALL_LIST_FILE="/etc/flatpak/system/install" -REMOVE_LIST_FILE="/etc/flatpak/system/remove" +INSTALL_LIST_FILE="/usr/share/bluebuild/default-flatpaks/system/install" +REMOVE_LIST_FILE="/usr/share/bluebuild/default-flatpaks/system/remove" +USER_INSTALL_LIST_FILE="/etc/bluebuild/default-flatpaks/system/install" +USER_REMOVE_LIST_FILE="/etc/bluebuild/default-flatpaks/system/remove" +# Prefer user's install + remove list over maintainer's, in case when same flatpak ID is present in maintainer's install list + user's remove list & vice-versa +# Also ignores words starting with # symbol, whitelines & duplicate entries +MAINTAINER_INSTALL_LIST=$(comm -23 <(sort "$INSTALL_LIST_FILE") <(sort "$USER_REMOVE_LIST_FILE") | grep -v -E '^#|^$' | awk '!seen[$0]++') +MAINTAINER_REMOVE_LIST=$(comm -23 <(sort "$REMOVE_LIST_FILE") <(sort "$USER_INSTALL_LIST_FILE") | grep -v -E '^#|^$' | awk '!seen[$0]++') +# Combine maintainer & user list. Ignore words starting with # symbol, whitelines & duplicate entries +COMBINED_INSTALL_LIST=$(cat <(echo "$MAINTAINER_INSTALL_LIST") "$USER_INSTALL_LIST_FILE" | grep -v -E '^#|^$' | awk '!seen[$0]++') +COMBINED_REMOVE_LIST=$(cat <(echo "$MAINTAINER_REMOVE_LIST") "$USER_REMOVE_LIST_FILE" | grep -v -E '^#|^$' | awk '!seen[$0]++') function notify-send-pre-install { user_name=$(loginctl list-sessions --output=json | jq -r '.[].user') @@ -84,11 +104,11 @@ function notify-send-uninstall { } # Install flatpaks in list -if [[ -f $INSTALL_LIST_FILE ]]; then +if [[ -f $INSTALL_LIST_FILE ]] || [[ -f $USER_INSTALL_LIST_FILE ]]; then if [[ -n $FLATPAK_LIST ]]; then - INSTALL_LIST=$(echo "$FLATPAK_LIST" | grep -vf - "$INSTALL_LIST_FILE") + INSTALL_LIST=$(comm -23 <(echo "$COMBINED_INSTALL_LIST" | sort) <(echo "$FLATPAK_LIST" | sort)) else - INSTALL_LIST=$(cat $INSTALL_LIST_FILE) + INSTALL_LIST="$COMBINED_INSTALL_LIST" fi if [[ -n $INSTALL_LIST ]] && [[ ! $NOTIFICATIONS == "true" ]]; then flatpak install --system --noninteractive "$REPO_NAME" ${INSTALL_LIST[@]} @@ -100,8 +120,8 @@ if [[ -f $INSTALL_LIST_FILE ]]; then fi # Remove flatpaks in list -if [[ -f $REMOVE_LIST_FILE ]]; then - REMOVE_LIST=$(echo "$FLATPAK_LIST" | grep -o -f - "$REMOVE_LIST_FILE") +if [[ -f $REMOVE_LIST_FILE ]] || [[ -f $USER_REMOVE_LIST_FILE ]]; then + REMOVE_LIST=$(comm -12 <(echo "$COMBINED_REMOVE_LIST" | sort) <(echo "$FLATPAK_LIST" | sort)) if [[ -n $REMOVE_LIST ]] && [[ ! $NOTIFICATIONS == "true" ]]; then flatpak uninstall --system --noninteractive ${REMOVE_LIST[@]} elif [[ -n $REMOVE_LIST ]] && [[ $NOTIFICATIONS == "true" ]]; then diff --git a/modules/default-flatpaks/user-config/notifications b/modules/default-flatpaks/user-config/notifications new file mode 100644 index 0000000..621c5e9 --- /dev/null +++ b/modules/default-flatpaks/user-config/notifications @@ -0,0 +1,6 @@ +# This file can be used by the users for configuration of `notifications` used by the the `default-flatpaks` BlueBuild module. +# If this file is not modified, the image's default configuration will be used instead (located in /usr/share/bluebuild/default-flatpaks/notifications). +# Possible values: true, false +# Here's an example on how to edit this file (ignore # symbol): +# +# false diff --git a/modules/default-flatpaks/user-config/system/install b/modules/default-flatpaks/user-config/system/install new file mode 100644 index 0000000..2def6c9 --- /dev/null +++ b/modules/default-flatpaks/user-config/system/install @@ -0,0 +1,10 @@ +# This file can be used by the users for configuration of `system flatpaks install` used by the `default-flatpaks` BlueBuild module. +# If this file is not modified, the image's default configuration will be used instead (located in /usr/share/bluebuild/default-flatpaks/system/install). +# This list uses the Flatpak ID format, with one ID per line. +# Duplicated entries won't be used if located in the image's default configuration. +# Flatpak runtimes are not supported. +# Here's an example on how to edit this file (ignore # symbol): +# +# org.gnome.Maps +# org.gnome.TextEditor +# org.telegram.desktop diff --git a/modules/default-flatpaks/user-config/system/remove b/modules/default-flatpaks/user-config/system/remove new file mode 100644 index 0000000..91c5dfc --- /dev/null +++ b/modules/default-flatpaks/user-config/system/remove @@ -0,0 +1,10 @@ +# This file can be used by the users for configuration for `system flatpaks removal` used by the `default-flatpaks` BlueBuild module. +# If this file is not modified, the image's default configuration will be used instead (located in /usr/share/bluebuild/default-flatpaks/system/remove). +# This list uses the Flatpak ID format, with one ID per line. +# Duplicated entries won't be used if located the image's default configuration. +# Flatpak runtimes are not supported. +# Here's an example on how to edit this file (ignore # symbol): +# +# org.gnome.Maps +# org.gnome.TextEditor +# org.telegram.desktop diff --git a/modules/default-flatpaks/user-config/user/install b/modules/default-flatpaks/user-config/user/install new file mode 100644 index 0000000..3fce777 --- /dev/null +++ b/modules/default-flatpaks/user-config/user/install @@ -0,0 +1,10 @@ +# This file can be used by the users for configuration of configuration for `user flatpaks install` used by the `default-flatpaks` BlueBuild module. +# If this file is not modified, the image's default configuration will be used instead (located in /usr/share/bluebuild/default-flatpaks/user/install). +# This list uses the Flatpak ID format, with one ID per line. +# Duplicated entries won't be used if located in the image's default configuration. +# Flatpak runtimes are not supported. +# Here's an example on how to edit this file (ignore # symbol): +# +# org.gnome.Maps +# org.gnome.TextEditor +# org.telegram.desktop diff --git a/modules/default-flatpaks/user-config/user/remove b/modules/default-flatpaks/user-config/user/remove new file mode 100644 index 0000000..b15d98a --- /dev/null +++ b/modules/default-flatpaks/user-config/user/remove @@ -0,0 +1,10 @@ +# This file can be used by the users for configuration of `user flatpaks removal` used by the `default-flatpaks` BlueBuild module. +# If this file is not modified, the image's default configuration will be used instead (located in /usr/share/bluebuild/default-flatpaks/user/remove). +# This list uses the Flatpak ID format, with one ID per line. +# Duplicated entries won't be used if located in the image's default configuration. +# Flatpak runtimes are not supported. +# Here's an example on how to edit this file (ignore # symbol): +# +# org.gnome.Maps +# org.gnome.TextEditor +# org.telegram.desktop diff --git a/modules/default-flatpaks/user-flatpak-setup b/modules/default-flatpaks/user-flatpak-setup index 9c7f1c0..c53a076 100755 --- a/modules/default-flatpaks/user-flatpak-setup +++ b/modules/default-flatpaks/user-flatpak-setup @@ -6,7 +6,7 @@ if grep -qz 'fedora' <<< "$(flatpak remotes)"; then flatpak remote-delete --user fedora-testing --force fi -REPO_INFO="/etc/flatpak/user/repo-info.yml" +REPO_INFO="/usr/share/bluebuild/default-flatpaks/user/repo-info.yml" REPO_URL=$(yq '.repo-url' $REPO_INFO) REPO_NAME=$(yq '.repo-name' $REPO_INFO) REPO_TITLE=$(yq '.repo-title' $REPO_INFO) @@ -24,21 +24,41 @@ if [[ ! $REPO_TITLE == "null" ]]; then fi # Notifications config -NOTIFICATIONS=$(cat /etc/flatpak/notifications) +NOTIFICATIONS_FILE="/usr/share/bluebuild/default-flatpaks/notifications" +USER_NOTIFICATIONS_FILE="/etc/bluebuild/default-flatpaks/notifications" +# Ignore words starting with # symbol, whitelines & duplicate entries for notifications config +MAINTAINER_NOTIFICATIONS=$(cat "$NOTIFICATIONS_FILE" | grep -v -E '^#|^$' | awk '!seen[$0]++') +USER_NOTIFICATIONS=$(cat "$USER_NOTIFICATIONS_FILE" | grep -v -E '^#|^$' | awk '!seen[$0]++') + +# If user modified notifications config, utilize user's configuration, otherwise maintainer's +if [[ -n $USER_NOTIFICATIONS ]]; then + NOTIFICATIONS="$USER_NOTIFICATIONS" +else + NOTIFICATIONS="$MAINTAINER_NOTIFICATIONS" +fi # Installed flatpaks FLATPAK_LIST=$(flatpak list --user --columns=application) # Flatpak list files -INSTALL_LIST_FILE="/etc/flatpak/user/install" -REMOVE_LIST_FILE="/etc/flatpak/user/remove" +INSTALL_LIST_FILE="/usr/share/bluebuild/default-flatpaks/user/install" +REMOVE_LIST_FILE="/usr/share/bluebuild/default-flatpaks/user/remove" +USER_INSTALL_LIST_FILE="/etc/bluebuild/default-flatpaks/user/install" +USER_REMOVE_LIST_FILE="/etc/bluebuild/default-flatpaks/user/remove" +# Prefer user's install + remove list over maintainer's, in case when same flatpak ID is present in maintainer's install list + user's remove list & vice-versa +# Also ignores words starting with # symbol, whitelines & duplicate entries +MAINTAINER_INSTALL_LIST=$(comm -23 <(sort "$INSTALL_LIST_FILE") <(sort "$USER_REMOVE_LIST_FILE") | grep -v -E '^#|^$' | awk '!seen[$0]++') +MAINTAINER_REMOVE_LIST=$(comm -23 <(sort "$REMOVE_LIST_FILE") <(sort "$USER_INSTALL_LIST_FILE") | grep -v -E '^#|^$' | awk '!seen[$0]++') +# Combine maintainer & user list. Ignore words starting with # symbol, whitelines & duplicate entries +COMBINED_INSTALL_LIST=$(cat <(echo "$MAINTAINER_INSTALL_LIST") "$USER_INSTALL_LIST_FILE" | grep -v -E '^#|^$' | awk '!seen[$0]++') +COMBINED_REMOVE_LIST=$(cat <(echo "$MAINTAINER_REMOVE_LIST") "$USER_REMOVE_LIST_FILE" | grep -v -E '^#|^$' | awk '!seen[$0]++') # Install flatpaks in list -if [[ -f $INSTALL_LIST_FILE ]]; then +if [[ -f $INSTALL_LIST_FILE ]] || [[ -f $USER_INSTALL_LIST_FILE ]]; then if [[ -n $FLATPAK_LIST ]]; then - INSTALL_LIST=$(echo "$FLATPAK_LIST" | grep -vf - "$INSTALL_LIST_FILE") + INSTALL_LIST=$(comm -23 <(echo "$COMBINED_INSTALL_LIST" | sort) <(echo "$FLATPAK_LIST" | sort)) else - INSTALL_LIST=$(cat $INSTALL_LIST_FILE) + INSTALL_LIST="$COMBINED_INSTALL_LIST" fi if [[ -n $INSTALL_LIST ]] && [[ ! $NOTIFICATIONS == "true" ]]; then flatpak install --user --noninteractive "$REPO_NAME" ${INSTALL_LIST[@]} @@ -50,8 +70,8 @@ if [[ -f $INSTALL_LIST_FILE ]]; then fi # Remove flatpaks in list -if [[ -f $REMOVE_LIST_FILE ]]; then - REMOVE_LIST=$(echo "$FLATPAK_LIST" | grep -o -f - "$REMOVE_LIST_FILE") +if [[ -f $REMOVE_LIST_FILE ]] || [[ -f $USER_REMOVE_LIST_FILE ]]; then + REMOVE_LIST=$(comm -12 <(echo "$COMBINED_REMOVE_LIST" | sort) <(echo "$FLATPAK_LIST" | sort)) if [[ -n $REMOVE_LIST ]] && [[ ! $NOTIFICATIONS == "true" ]]; then flatpak uninstall --user --noninteractive ${REMOVE_LIST[@]} elif [[ -n $REMOVE_LIST ]] && [[ $NOTIFICATIONS == "true" ]]; then