How can I start my application in a more convenient way?
A script is quite overkill.
Use a .desktop file like:
[Desktop Entry]
Exec=/bin/bash -c "cd ~/MyDirectory && myapp some_arguments"
Name=Some App
Type=Application
- Save it as
some_app.desktop
- Make it executable and double click
N.B.
The question is if it needs to be run from its own directory or not. If not, the command could even be simpler:
Exec='/home/MyUserName/MyDirectory/myapp' some_arguments
Create a file with following content:
#!/bin/bash
cd ~/MyDirectory
./myapp +some arguments
Then make it executable:
chmod u+x scriptname
Now you can call this script like this: /pathtoscript/scriptname
You can combine this with answer by v010dya, and put this script in any bin
that is in the $PATH, so both calling methods are possible: in the shell in any directory type scriptname
or use the desktop shortcut explained below. Just change /pathtoscript
to the actual placement of the script.
Make a shortcut to the script, place it in ~/.local/share/applications/
and name it like somename.desktop with the following content:
[Desktop Entry]
Version=1.0
Name=Script
Comment=
Keywords=Script
Exec=/pathtoscript/scriptname
Terminal=false
X-MultipleArgs=true
Type=Application
Icon=preferences-system
Categories=GTK;Development;
StartupNotify=false
Then it will appear in the applications list