@@ -35,34 +35,24 @@ function add_repository {
3535 fi
3636}
3737
38- function add_system_flatpak_remote() {
39- local REMOTE_NAME=" ${1} "
40- local REMOTE_URL=" ${2} "
41-
42- if ! flatpak remotes | grep -q " ^${REMOTE_NAME} \s" ; then
43- echo -e " Adding the \e[0;33m${REMOTE_NAME} \e[0m system flatpak remote..."
44- update_file_if_distinct " ${REPO_DATA_DIR} /flatpak/keys/${REMOTE_NAME} " " ${ROOT_VAR_LIB} /flatpak/repo/${REMOTE_NAME} .trustedkeys.gpg"
45- run_as_su flatpak remote-add --if-not-exists " ${REMOTE_NAME} " " ${REMOTE_URL} "
46- fi
47- }
48-
49- function add_user_flatpak_remote() {
50- local REMOTE_NAME=" ${1} "
51- local REMOTE_URL=" ${2} "
52-
53- if ! flatpak remotes | grep -q " ^${REMOTE_NAME} \s" ; then
54- echo -e " Adding the \e[0;33m${REMOTE_NAME} \e[0m user flatpak remote..."
55- update_file_if_distinct " ${REPO_DATA_DIR} /flatpak/keys/${REMOTE_NAME} " " ${XDG_DATA_HOME} /flatpak/repo/${REMOTE_NAME} .trustedkeys.gpg"
56- flatpak remote-add --user --if-not-exists " ${REMOTE_NAME} " " ${REMOTE_URL} "
38+ function add_flatpak_remote() {
39+ local INSTALLATION_METHOD=" ${1} "
40+ local REMOTE_NAME=" ${2} "
41+ local REMOTE_URL=" ${3} "
42+
43+ if ! flatpak remotes --" ${INSTALLATION_METHOD} " | grep -q " ^${REMOTE_NAME} $" ; then
44+ echo -e " Adding the \e[0;33m${REMOTE_NAME} \e[0m ${INSTALLATION_METHOD} flatpak remote..."
45+ # update_file_if_distinct "${REPO_DATA_DIR}/flatpak/keys/${REMOTE_NAME}" "${XDG_DATA_HOME}/flatpak/repo/${REMOTE_NAME}.trustedkeys.gpg"
46+ flatpak remote-add --" ${INSTALLATION_METHOD} " --if-not-exists " ${REMOTE_NAME} " " ${REMOTE_URL} "
5747 fi
5848}
5949
6050if does_bin_exist ' flatpak' ; then
61- add_system_flatpak_remote ' flathub' ' https://flathub.org/repo/flathub.flatpakrepo'
62- add_system_flatpak_remote ' flathub-beta' ' https://flathub.org/beta-repo/flathub-beta.flatpakrepo'
51+ add_flatpak_remote ' system ' ' flathub' ' https://flathub.org/repo/flathub.flatpakrepo'
52+ add_flatpak_remote ' system ' ' flathub-beta' ' https://flathub.org/beta-repo/flathub-beta.flatpakrepo'
6353
64- add_user_flatpak_remote ' flathub' ' https://flathub.org/repo/flathub.flatpakrepo'
65- add_user_flatpak_remote ' flathub-beta' ' https://flathub.org/beta-repo/flathub-beta.flatpakrepo'
54+ add_flatpak_remote ' user ' ' flathub' ' https://flathub.org/repo/flathub.flatpakrepo'
55+ add_flatpak_remote ' user ' ' flathub-beta' ' https://flathub.org/beta-repo/flathub-beta.flatpakrepo'
6656fi
6757
6858if [ " ${DISTRO_FAMILY} " = ' Arch' ]; then
0 commit comments