7

for example, this terminal command: ping www.google.com so my question is how can I create a launcher in my desktop can do this command, so there is no longer needs to open terminal every time and write this it.

5 Answers 5

10

Well you could create a new document on your Desktop, name it something.desktop like ping1.desktop

Then put this in, Name= & Icon= lines can be whatever you want (usually best to full path Icon=) or you can leave Icon= blank

[Desktop Entry]
Version=1.0
Type=Application
Terminal=true
Exec=ping www.google.com
Name=whatever you want
Icon= 

After creating right click on the launcher > Properties > Permissions > & check the Execute: box

(- you could also extend it's use to other pings if you use in unity's launcher via added quicklist entries in the .desktop

0
3

It took me a while to understand this because I'm a total Ubuntu beginner. Eventually, I figured it out:

  1. Right click on desktop. From the pop-up menu select "New Document", then "Empty Document".

  2. Name the document something.desktop, where "something" is replaced by the name you want.

  3. Open the document with gedit (usually just by double clicking).

  4. In gedit paste the following in, where "whatever you want" is the name of the launcher you choose, and where "path to icon", is the path to the icon you want, i.e. the directory location of the icon image:

    [Desktop Entry]
    Version=1.0
    Type=Application
    Terminal=true
    Exec=ping www.google.com
    Name= whatever you want
    Icon= path to icon
    
  5. After creating, right click on the launcher, go to Properties → Permissions, and check the Execute box.

0

For example, to find the path to execute Spyder, type : "which spyder" in the terminal and the response was for me : /home/tech/anaconda3/bin/spyder

Then I wrote this in spyder.desktop :

[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=/home/tech/anaconda3/bin/spyder
Name=spyder
Icon=/usr/share/spyder/images/spyder.png
1
  • 1
    pls be more elaborate about what to do with the *.desktop file, where to save etc
    – d1bro
    Nov 30, 2018 at 20:30
0

There is no entry in the launcher creator GUI, in mate, to specify that the launcher should launch in terminal. So I followed the text files route. Works fine except with this:

Exec=TZ=US/Pacific korganizer %U

When I try to run TZ=US/Pacific korganizer %U in terminal, it works fine.

What it does, by adding the TZ= to it, is it allows me to launch the calendar, fixed in a certain time zone, which is not the same as the system timezone. SO it is as if korganizer is running on a system in said timezone.

The launcher flatout will not work, in this case. This, in spite of having designated Terminal=true in the launcher text file. Again the same command launches Korganizer, just fine, if entered into an actual terminal.

-1

Or even easier: To run atari800 emulator 1) in terminal type "which atari800" 2) right click mouse on desktop and select "create launcher" 3) enter following in launched properties: a) Name: Atari800 b) Command: /usr/bin/atari800 (the path returned by step 1 in the terminal). c) comment: whatever you want (e.g. Atari800 emulator". d) tick Launch in terminal 4) Click OK in launcher properties,

Note this is in linux mint mate, may not be same for other distributions.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .