Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AppImage Portable Home Paths #8

Closed
Kodiman opened this issue Aug 8, 2017 · 9 comments
Closed

AppImage Portable Home Paths #8

Kodiman opened this issue Aug 8, 2017 · 9 comments

Comments

@Kodiman
Copy link

Kodiman commented Aug 8, 2017

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
Copy link
Contributor

AppImage/AppImageKit@d17fdef 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.

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
Copy link
Owner

CalebQ42 commented Aug 8, 2017

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
Copy link
Author

Kodiman commented Aug 8, 2017

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
Copy link
Contributor

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
Copy link
Author

Kodiman commented Aug 8, 2017

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
Copy link
Contributor

Please open a feature request in the AppImageKit project @Kodiman

@CalebQ42
Copy link
Owner

CalebQ42 commented Aug 9, 2017

They have been implemented.

@CalebQ42 CalebQ42 closed this as completed Aug 9, 2017
@Kodiman
Copy link
Author

Kodiman commented Aug 9, 2017

hi, excellent. you are the best. thanks.

@RoyiAvital
Copy link

@Kodiman , You're totally right about your suggestion at #8 (comment). 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants