Saturday, September 7, 2019

13.04 - How To Create Launcher For Application?


I am using Ubuntu 13.04, I recently downloaded Fritzing .tar.bz2 , which I extracted it & there is one .sh file, which I have to execute everytime from terminal to run the application.


My question is, Is it possible to create a launcher of Fritzing & make it show up in Applications in Dash ? If it is, then please help me out with steps.


Thank you.



Ok, this is quite simple, what you want to create is a named file with a .desktop extension with contents like this:


[Desktop Entry]
Name=Steam
Comment=Application for managing and playing games on Steam
Exec=/usr/bin/steam %U
Icon=steam
Terminal=false
Type=Application
Categories=Network;FileTransfer;Game;
MimeType=x-scheme-handler/steam;
Actions=Store;Community;Library;Servers;Screenshots;News;Settings;BigPicture;Friends;

Here is an image


To create this file globally you can run your favorite text editor as root using sudo, using the terminal application. If it's a graphical editor, keep your environment clean by adding the -H flag:


sudo -H gedit

Browse to the /usr/share/applications/
directory. It should look something like this:


enter image description here


Select any .desktop file, it should look something like the steam.desktop example above. After you have edited it it should be close to this:


[Desktop Entry]
Name=Fritzing
Comment=
Exec=sh [link to file]
Icon=[link to icon(not required)]
Terminal=false
Type=Application
Categories=[choose what categories you want this file to fit into such as Game,Browser ext.]

It is important to note that the path to the files has to be the full path. Tilde expansion won't work so you can use ~/ paths. Also if you want to run your script as root you can add gksudo (gksudo has been removed from ubuntu as of 13.04, you can install it by running the command sudo apt-get install gksu in the terminal) before the sh command on the Exec= line.


Once you have saved your file, right click, go into properties, permissions and make sure that Allow executing as file is ticked. Then restart, it may not be required though.


Terminal way:


cd /usr/share/applications/
sudo -H gedit [your chosen desktop file]

or


sudo nano [your chosen desktop file]

Edit it then save as what you want to call it.


chmod a+x [your saved desktop file]

You may need to restart you pc


sudo reboot

No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...