I know it’s a simple thing but I still can’t figure it out.
I have compiled a 3D design program called “Armorpaint”.
I managed to get it right and the program runs. My problem is that for it to run I have to enter the terminal and run this command:
cd /home/username/armorpaint/armorcore/Deployment && ./ArmorPaint …/…/…/build/krom
I have created a text file and given it permissions to run as a program, however I always have to right click and tell it to run as a program for it to run properly.
What I want is to make a launcher so I can put it in my dock and from there open the program normally. I tried to use “free menu” but for some reason it doesn’t work well, I tried to use other programs to create launchers but they don’t seem to accept the command line I put for this purpose.
If someone could help me with this task I would appreciate it very much.
You can probably do similar to what I did when making my own package for the pyCharm app from the tar file that they had. You can create a launcher in /usr/local/share/applications with content similar to below:
# cat jetbrains-pycharm-ce.desktop
[Desktop Entry]
Version=1.0
Type=Application
Name=PyCharm Community Edition
Icon=/opt/pycharm/bin/pycharm.svg
Exec="/opt/pycharm/bin/pycharm.sh" %f
Comment=Python IDE for Professional Developers
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-pycharm-ce
Change the icon and exec fields, so maybe it would look something like this:
and save it in the directory I mentioned as armorpaint.desktop. To refresh your menu, run:
gtk-update-icon-cache
you may also need to log out. If providing the path like I did in EXEC doesn’t work, then put your script here which you tried to run before with the cd command in, etc. Running it the way I did, means you need to put the full path to the krom directory. The %f should allow you to open files created with that app, unless krom is the file you are opening to edit. In which case remove the %f.
I made my .deskto file and everything. i place it on the folders you mentioned and in other where ialso found .desktop files of others app ihave installed, then i run gtk-update-icon-cache but it didn´t work. i can not find my icon, so i can not run it, so i don´t know if it is working or not.
You have to replace the …/…/…/ as I told you in my post and put the full path. Also, if krom is a file you are opening you don’t need the %f as I also wrote.
Also I forgot, after deployment, you need to also put /Armorpaint. So your EXEC line will look like:
The argument to ArmorPaint is a relative path. You do know the absolute path too:
ArmorPaint /home/user/build/krom
With the absolute path it does not matter what the current working directory is; we can call ArmorPaint from anywhere.
The ./ in ./ArmorPaint, because the directory /home/user/armorpaint/armorcore/Deployment is not on the PATH.
The ./ArmorPaint is relative and in your case means /home/user/armorpaint/armorcore/Deployment/ArmorPaint.
is a single command and can be called from any location.
It will fail only if the ArmorPaint expects current working directory to be the directory, where the program is.
The PATH should already contain entry ~/.local/bin. That is one of “standard locations”. In other words, if the executable would be in directory, /home/user/.local/bin/, then you could call it with plain filename: ArmorPaint.
(This too assumes that the program does not have supporting files that it seeks relative to its own location.)
i did the fix. but i still not seen my icon anywhere. I trayed to use “appeditor” app but i doesn´t let me save. i guess the command line doesn´t like it.
I am not very good at these things, although I have made launchers in other linux distributions before, but for some reason this one is not working for me.
And well it’s the first time I compile an application.
What I find curious is that if I “run as a program” the text file I made with the command line I showed you in my first post, the app runs.
This runs a program named ArmorPaint and provides a commandline parameter to it that says “/home/user/armorpaint/build/krom”. You also have a %f at the end of that line whose function I’m not sure of.
In summary, your first commandline runs two programs, one right after the other. The second commandline runs one program only. So they don’t (and can’t) do the same thing.