Portable configuration data


#1

a portable application should be portable no? this means not leaving traces in $home, %appdata, etc. deployable from a network share, usb fs, anywhere, but generating many likely conflicts from for example ~/.links2 across my network. I love what yall are driving at here but until I can see some method of like installing to a USB disk and keeping libraries [which works thus farly] AS WELL as configuration uhhh like vmwares thinapp system. Portableapps platform is another good one, again, only on windows… then again one can just write a batch script giving environmental prams set appdata=%CD%\data on some things.
dephell is never a fun place to be, i dont know where to post this but try and hear me :slight_smile: you all rock


#2

AppImages are “portable” in the sense that you can copy the one app = one file to a different system and it should run.

They are not portable in the sense that data (such as created documents and/or settings, caches) travels with them.

But on Linux, this is quite easy to achieve:
Simply launch it like this: export HOME=/where/you/want/your/data ./some.AppImage. You can even put something like this into a script.

If have been considering to make the following feature: If there is a directory with the same name as the AppDir and a special suffix present next to the AppImage location, then use that as the $HOME for the AppImage. Would you be interested in such a functionality?


#3

oh that is exactly what im looking for, ive already been using the bash function export HOME on several other scripts
brilliant!


#4

Similar discussion: https://github.com/AppImage/AppImageSpec/issues/4


#5

I though the same thing and that’s why I created (LinuxPA)[http://GitHub.com/CalebQ42/LinuxPA]. If you go into setting and enable common.sh it will run before the program, so you can set things such as HOME (which the default common.sh does).


#6

https://github.com/AppImage/AppImageKit/commit/d17fdefadcb98befa66c29137ce25731256f8f2a implements the following:

  • If there is a directory with the same name as the AppImage plus .home, then export $HOME.
  • If there is a directory with the same name as the AppImage plus .config, then export $XDG_CONFIG_HOME.

All new AppImages generated with the latest continuous build of appimagetool will have this functionality.

Depending on how well this works in practice, it may become part of the spec.


#7

Example on how to use this.

Imagine you want to use the Leafpad text editor, but carry its settings around with the executable.

You can do the following:

# Download Leafpad AppImage and make it executable
wget -c "https://bintray.com/probono/AppImages/download_file?file_path=Leafpad-0.8.18.1.glibc2.4-x86_64.AppImage" -O Leafpad-0.8.18.1.glibc2.4-x86_64.AppImage
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

Note that the file leafpadrc was written in the directory we have created before.


#8

Hello probono,

i have follow the same step for firefox appimage.
Created Firefox-54.0.glibc2.3.4-x86_64.AppImage.config directory for Firefox-54.0.glibc2.3.4-x86_64.AppImage .
Make changes to settings in the firefox.
close it.
i don’t see any new data been saved in Firefox-54.0.glibc2.3.4-x86_64.AppImage.config directory .

please enlighten me on where are the data been saved to?

How do i make sure my data are store along with appimage in the same directory?


#9

This AppImage does not have this functionality yet. It was introduced in a later version of AppImageKit.


#10

First quit all currently running instances of Firefox:

killall firefox

Then download the AppImage from https://bintray.com/probono/AppImages/Firefox/56.0.2.glibc2.3.4#files

mkdir Firefox-56.0.2.glibc2.3.4-x86_64.AppImage.home
./Firefox-56.0.2.glibc2.3.4-x86_64.AppImage

After running the AppImage, you can inspect the contents of Firefox-56.0.2.glibc2.3.4-x86_64.AppImage.home and you will see stuff has been saved there:

me@host:~/Downloads$ find Firefox-56.0.2.glibc2.3.4-x86_64.AppImage.home/ | head -n 10
Firefox-56.0.2.glibc2.3.4-x86_64.AppImage.home/
Firefox-56.0.2.glibc2.3.4-x86_64.AppImage.home/Desktop
Firefox-56.0.2.glibc2.3.4-x86_64.AppImage.home/.cache
Firefox-56.0.2.glibc2.3.4-x86_64.AppImage.home/.cache/fontconfig
(...)
Firefox-56.0.2.glibc2.3.4-x86_64.AppImage.home/.cache/fontconfig/CACHEDIR.TAG
Firefox-56.0.2.glibc2.3.4-x86_64.AppImage.home/.cache/mozilla
(...)

Bundle appimages of programs that save data in the home folder?
#11

See this asciicinema for a live demo:

https://asciinema.org/a/SGKGaxZ99Gf3tOsdrlZICpDLz


#12

probono: ok

thank you.