CalebQ42 / LinuxPA

A PortableApps.com type launcher for linux
MIT License
30 stars 1 forks source link

AppImage Portable Home Paths #8

Closed Kodiman closed 7 years ago

Kodiman commented 7 years ago

hi, for quality control, there needs to be an option for each appimage program to have its own separate settings folders. please provide an environment variable inside LinuxPA (such as PANAME) that is the filename of a launched appimage. or how else to solve this. thanks!

common.sh export HOME=$PWD/Home-PA/$PANAME.home export XDG_CONFIG_HOME=$PWD/Home-PA/$PANAME.config

example of result subfolders /Home-PA/Firefox-54.0.glibc2.3.4-x86_64.AppImage.home /Home-PA/Firefox-54.0.glibc2.3.4-x86_64.AppImage.config /Home-PA/Thunderbird-45.4.0.glibc2.3.3-x86_64.AppImage.home /Home-PA/Thunderbird-45.4.0.glibc2.3.3-x86_64.AppImage.config

probonopd commented 7 years ago

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

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

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

Notice that Leafpad has written its configuration file leafpadrc into the directory we had created.

If it does not work with your AppImage, make sure it was generated with the latest appimagetool continuous build as of today. If your application does not honor $XDG_CONFIG_HOME (it should), then please file a bug with the application developer and use a directory with the same name as the AppImage plus the .home extension in the meantime.

CalebQ42 commented 7 years ago

Great Suggestions! I'll definitely add the $PANAME variable. I'll probably also add a setting to make it automatically create the .home and .config directories when the app is launched or downloaded.

Sent from my Google Nexus 5 CAF using FastHub

Kodiman commented 7 years ago

yes, please do both. note that (as of the current runtime version) the auto create directories should be in in the same directory as the AppImage. so that the new appimage runtime sees and uses them.

and, to make it better, probonopd really should have the runtime also look for home directories with the short app name (such as the [Desktop Entry], Name=). best you do that for auto create. thanks

Firefox.AppImage.home Firefox.AppImage.config

excellent. much appreciated. thanks.

probonopd commented 7 years ago

probonopd really should have the runtime also look for home directories with the short app name (such as the [Desktop Entry], Name=)

What would be the advantage of this? This could even mean that different versions of the same application would re-use the same directories, which I am not sure is what people would want.

Kodiman commented 7 years ago

hi, using the "Desktop-Entry-Name" allows keeping settings when auto upgrading app versions. the logic can be to first search for portable home directories by filename (as you do now) and if not found then search by short app name (such as the prefix and/or "desktop-entry-name").

probonopd commented 7 years ago

Please open a feature request in the AppImageKit project @Kodiman

CalebQ42 commented 7 years ago

They have been implemented.

Kodiman commented 7 years ago

hi, excellent. you are the best. thanks.

RoyiAvital commented 6 years ago

@Kodiman , You're totally right about your suggestion at https://github.com/CalebQ42/LinuxPA/issues/8#issuecomment-321019553. The current filenames doesn't make sense for the average end user.

I'd say that application in the context of integrating to the system should be named similarly to what you suggested.