Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

I use a dongle for using internet on my kubuntu desktop. But to use the dongle, everytime I have to run MobilePartner from /usr/local/airtel/MobilePartner using terminal. Is there any way I can create a desktop shortcut for the command above.

Can a app do it?

share|improve this question

marked as duplicate by Radu Rădeanu, Eric Carvalho, Warren Hill, guntbert, Avinash Raj Mar 25 at 15:34

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers 2

You can create a .desktop file in your /home/user/Desktop/ directory that looks like this:

[Desktop Entry]
Version=x.y
Name=ProgramName
Comment=This is my comment
Exec=/home/alex/Documents/exec.sh
Icon=/home/alex/Pictures/icon.png
Terminal=false
Type=Application
Categories=Utility;Application;

This the user must be owner of this file and the executable permission must be set, see my example:

example .desktop file

And here the file:

user@host:~# ls -la /home/user/Desktop/firefox.desktop
-rwx------ 1 user user 9177 Dec 27 08:27 /home/user/Desktop/firefox.desktop

For more information see the wiki.

share|improve this answer
    
but every time i have to run the command from terminal as root,how can i get root access in the above method. –  user228116 Dec 27 '13 at 7:46
    
Then use gksu. Write the Exec-part like this: Exec=gksu /usr/local/airtel/MobilePartner. –  chaos Dec 27 '13 at 8:18

Normally, Mobile Partner application makes a Desktop Shortcut. Certain times it may become invisible for some reasons. To solve this:

  • Press Ctrl+Alt+T to open a terminal. In the prompt type, gksudo gedit and make a space infront.
  • In file browser go to the folder /usr/share/applications. Here find if there a Mobile Partner Icon.
  • If present Drag and Drop it to the terminal. Then press Enter
  • In the resulting text file, go to the line starts with Exec=. At the end of this line it should be %F. Change the content.
  • Then go to the line starts with NoDisplay=. It should be NoDisplay=false. If present is true, change it.
  • Then save the file and close.

If there is no such icon (Desktop configuration file) in /usr/share/applications, You need to create a new one.

For that, run :

gksudo gedit /usr/share/applications/MobileParter.desktop

In the resulting empty text file, Copy and Paste the following and save.

[Desktop Entry]
Encoding=UTF-8
Name=Mobile Partner
Comment=Mobile Partner Airtel 
TryExec=sudo /usr/local/airtel/MobilePartner
Exec=sudo /usr/local/airtel/MobilePartner %F
StartupNotify=true
Terminal=false
Type=Application
Icon=/usr/local/airtel/mobile.png
NoDisplay=false
MimeType=applications/php

There will be the icon in dash now.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.