I'm on Slackware 14.1 (current) and using zsh as my shell but I think this might be a general question.
Problematic program is Synfig Studio which comes as a generalized binary package containing its own bin, etc, share and lib directories.
I have installed it into ~/Apps/Synfig which contains Synfigs local file structure.
Running it from the shell/terminal with /home/me/Apps/Synfig/bin/synfigstudio works as expected.
It picks up the library path without updating environment variables and the program finds all its components, plugins, icons and the like.
Running it from a script, however, required me to set up the LD_LIBRARY_PATH variable to get it running in the first place but it can't find any of its icons, giving me error messages like:
Code:
Gtk-WARNING **: Error loading icon: Failed to open file '/opt/synfig/share/pixmaps/synfigstudio/set_fill_color.png': No such file or directory
Repeated for all the assets.
Thing is, these files really do not exist there, yet if the program is launched from the shell then it picks its own local structure out correctly, not looking into /opt/.
Why is that and how can I set that up for the script?
Solution:
a cd to the Synfig local root folder before running the binary did the trick.
In the case of my script:
Code:
#!/bin/bash
restrictwacom.sh
DEVICE="Wacom Intuos3 9x12"
STYLUS="$DEVICE stylus"
ERASER="$DEVICE eraser"
PAD="$DEVICE pad"
sh wacomdefaults.sh
export PATH=/home/me/Apps/Synfig/bin:${PATH}
export LD_LIBRARY_PATH=/home/me/Apps/Synfig/lib:${LD_LIBRARY_PATH}
cd /home/me/Apps/Synfig/
synfigstudio