File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -181,7 +181,16 @@ cat > "$HOOKFILE" <<\EOF
181
181
182
182
gsettings get org.gnome.desktop.interface gtk-theme 2> /dev/null | grep -qi "dark" && GTK_THEME_VARIANT="dark" || GTK_THEME_VARIANT="light"
183
183
APPIMAGE_GTK_THEME="${APPIMAGE_GTK_THEME:- " Adwaita:$GTK_THEME_VARIANT " } " # Allow user to override theme (discouraged)
184
- CACHEDIR="$( mktemp -d /tmp/.AppRun.XXXXXXXX) "
184
+
185
+ # in case we run from an AppImage, we use the $APPDIR environment variable as a template for the temporary directory that should be created
186
+ # this allows users to attribute the tempdir to the running AppImage
187
+ if [[ "$APPDIR " != "" ]]; then
188
+ tempdir_template="$APPDIR ".ld-p-gtk-tmp
189
+ else
190
+ tempdir_template=/tmp/.ld-p-gtk-tmp-XXXXXX
191
+ fi
192
+
193
+ CACHEDIR="$( mktemp -d " $tempdir_template " ) "
185
194
186
195
export APPDIR="${APPDIR:- " $( dirname " $( realpath " $0 " ) " ) " } " # Workaround to run extracted AppImage
187
196
export GTK_DATA_PREFIX="$APPDIR "
You can’t perform that action at this time.
0 commit comments