diff options
author | CoprDistGit <infra@openeuler.org> | 2024-08-01 13:51:43 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2024-08-01 13:51:43 +0000 |
commit | cd0127fd7215eb9cf324ad1dfb491c16f6fd5681 (patch) | |
tree | be6b45fd75438edb92d0d4f5413f847b007b045c /start-dconf-editor.sh | |
parent | dd17d28c17711e3c442b931a164d2e31fc8ce1a0 (diff) |
automatic import of dconf-editoropeneuler24.03_LTS
Diffstat (limited to 'start-dconf-editor.sh')
-rw-r--r-- | start-dconf-editor.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/start-dconf-editor.sh b/start-dconf-editor.sh new file mode 100644 index 0000000..8b6d2f8 --- /dev/null +++ b/start-dconf-editor.sh @@ -0,0 +1,25 @@ +#!/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 "$@" |