Access directory for AppImage

Hello. I built an X.AppImage application from a .deb package with the pkg2appimage tool.

The application runs fine.

The problem: during its execution, the X application (not AppImage) reads files in a /usr/share/ directory.

The X.AppImage application does the same thing and reads in the /usr/share/ directory (instead of X.AppDir/usr/share/)

How to force X.AppImage to use the directory “X.AppDir/usr/share/”

You can’t force it without editing the source code if it’s hardcoded. This is an annoyance I noticed with the mGBA AppImage as it tries to find shaders under /usr/share as well.

Maybe you’re lucky and the application has a flag or environment variable to change its search location? That’s all down to the app dev though

Change the source code of the application to load its resources from a path relative to the main executable, rather than from an absolute path.

This is known as “making an application relocatable”.