Enable portable configuration using special directories
mainYou can force an AppImage to store its configuration files alongside the executable instead of in the user's $HOME directory. This is ideal for portable use cases (e.g., running from a USB stick).
To achieve this, create one of the following directories in the same folder as the AppImage:
<AppImageName>.home: Sets$HOMEto this directory before executing the application.<AppImageName>.config: Sets$XDG_CONFIG_HOMEto this directory before executing the application.
Example for portable settings:
# Make the AppImage executable
chmod a+x Leafpad-0.8.18.1.glibc2.4-x86_64.AppImage
# Create a .config directory to redirect settings
mkdir Leafpad-0.8.18.1.glibc2.4-x86_64.AppImage.config
# Run the AppImage; settings will now be written to the .config directory
./Leafpad-0.8.18.1.glibc2.4-x86_64.AppImage# Download Leafpad AppImage and make it executable
chmod a+x Leafpad-0.8.18.1.glibc2.4-x86_64.AppImage
# Create a directory with the same name as the AppImage plus the ".config" extension
# in the same directory as the AppImage
mkdir Leafpad-0.8.18.1.glibc2.4-x86_64.AppImage.config
# Run Leafpad, change some setting (e.g., change the default font size) then close Leafpad
./Leafpad-0.8.18.1.glibc2.4-x86_64.AppImage
# Now, check where the settings were written:
linux@linux:~> find Leafpad-0.8.18.1.glibc2.4-x86_64.AppImage.config
(...)
Leafpad-0.8.18.1.glibc2.4-x86_64.AppImage.config/leafpad/leafpadrc