dconf-editor/start-dconf-editor.sh
Petr Šabata 6031ac6142 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/dconf-editor#75fcd3cf7a6948e4b786900a7c9295498cd88597
2020-10-14 23:31:39 +02:00

26 lines
676 B
Bash

#!/usr/bin/bash
IFS=: read -ra host_data_dirs < <(flatpak-spawn --host sh -c 'echo $XDG_DATA_DIRS')
# To avoid potentially muddying up $XDG_DATA_DIRS too much, we link the schema paths
# into a temporary directory.
bridge_dir=$XDG_RUNTIME_DIR/dconf-bridge
mkdir -p "$bridge_dir"
for dir in "${host_data_dirs[@]}"; do
if [[ "$dir" == /usr/* ]]; then
dir=/run/host/"$dir"
fi
schemas="$dir/glib-2.0/schemas"
if [[ -d "$schemas" ]]; then
bridged=$(mktemp -d XXXXXXXXXX -p "$bridge_dir")
mkdir -p "$bridged"/glib-2.0
ln -s "$schemas" "$bridged"/glib-2.0
XDG_DATA_DIRS=$XDG_DATA_DIRS:"$bridged"
fi
done
export XDG_DATA_DIRS
exec dconf-editor "$@"