diff --git a/lib-flatpak.sh b/lib-flatpak.sh index d03ed076..9ad35cac 100755 --- a/lib-flatpak.sh +++ b/lib-flatpak.sh @@ -2,14 +2,12 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -[[ -n "$PAKITHEME_VERBOSE" ]] && set -x ||: - die() { echo "$@" >&2 exit 1 } -pakitheme() { +pakitheme_gtk3() { local color="$(destify ${1})" local opacity="$(destify ${2})" local alt="$(destify ${3})" @@ -17,12 +15,12 @@ pakitheme() { local FLATPAK_THEME="${name}${color}${opacity}${alt}${theme}" - local GTK_THEME_VER=3.22 + local GTK_3_THEME_VER=3.22 local cache_home="${XDG_CACHE_HOME:-$HOME/.cache}" local data_home="${XDG_DATA_HOME:-$HOME/.local/share}" local pakitheme_cache="$cache_home/pakitheme" local repo_dir="$pakitheme_cache/repo" - local app_id="org.gtk.Gtk3theme.$FLATPAK_THEME" + local gtk3_app_id="org.gtk.Gtk3theme.$FLATPAK_THEME" local root_dir="$pakitheme_cache/$FLATPAK_THEME" local repo_dir="$root_dir/repo" local build_dir="$root_dir/build" @@ -57,40 +55,40 @@ pakitheme() { cp -a "$theme_path/gtk-3.$theme_gtk_version/"* "$build_dir/files" mkdir -p "$build_dir/files/share/appdata" - cat >"$build_dir/files/share/appdata/$app_id.appdata.xml" <"$build_dir/files/share/appdata/$gtk3_app_id.appdata.xml" < - $app_id + $gtk3_app_id CC0-1.0 - $flatpak_name Gtk theme - $flatpak_name Gtk theme (generated via pakitheme) + $FLATPAK_THEME Gtk theme + $FLATPAK_THEME Gtk theme (generated via pakitheme) EOF - appstream-compose --prefix="$build_dir/files" --basename="$app_id" --origin=flatpak "$app_id" + appstream-compose --prefix="$build_dir/files" --basename="$gtk3_app_id" --origin=flatpak "$gtk3_app_id" ostree --repo="$repo_dir" commit -b base --tree=dir="$build_dir" bundles=() while read -r arch; do - bundle="$root_dir/$app_id-$arch.flatpak" + bundle="$root_dir/$gtk3_app_id-$arch.flatpak" rm -rf "$build_dir" ostree --repo="$repo_dir" checkout -U base "$build_dir" read -rd '' metadata < "$build_dir/metadata" - ostree --repo="$repo_dir" commit -b "runtime/$app_id/$arch/$GTK_THEME_VER" \ + ostree --repo="$repo_dir" commit -b "runtime/$gtk3_app_id/$arch/$GTK_3_THEME_VER" \ --add-metadata-string "xa.metadata=$(cat $build_dir/metadata)" --link-checkout-speedup "$build_dir" - flatpak build-bundle --runtime "$repo_dir" "$bundle" "$app_id" "$GTK_THEME_VER" + flatpak build-bundle --runtime "$repo_dir" "$bundle" "$gtk3_app_id" "$GTK_3_THEME_VER" trap 'rm "$bundle"' EXIT diff --git a/lib-install.sh b/lib-install.sh index c9b80241..08826b43 100755 --- a/lib-install.sh +++ b/lib-install.sh @@ -741,7 +741,7 @@ connect_flatpak() { for alt in "${alts[@]}"; do for theme in "${themes[@]}"; do for color in "${colors[@]}"; do - pakitheme "${color}" "${opacity}" "${alt}" "${theme}" + pakitheme_gtk3 "${color}" "${opacity}" "${alt}" "${theme}" done done done