launch terminal with command from desktop?

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help

launch terminal with command from desktop?

Postby jms on Thu Jan 24, 2013 10:15 pm

Hi, I would like to create a desktop icon that will launch the terminal window and automatically exectute a given command (ssh to a remote server in this case).

How would I go about doing this?

Level 1
Level 1
Posts: 21
Joined: Wed Jan 02, 2013 1:36 pm

Linux Mint is funded by ads and donations.

Re: launch terminal with command from desktop?

Postby jungle_boy on Thu Jan 24, 2013 10:40 pm

1- You need to create a shell script:

Code: Select all

2- Make it executable and change permissions:

Code: Select all
#chmod +X name_of_your_shell_script
#chmod -R 777 name_of_your_shell_script

3- Right click on desktop and create a launcher to your shell script

More informations in:
LM17.1 Cinnamon (PC) and KDE 17.2 (Laptop) with AMD Catalyst
HP Pavilion g4-1316br, AMD Quad Core, 1,5 GHz, Radeon 6520G/7450M,
Linuxcounter Registered User #506065 (2008)
User avatar
Level 7
Level 7
Posts: 1629
Joined: Thu Aug 19, 2010 2:51 pm
Location: Amazon Rain Forest, Brazil

Re: launch terminal with command from desktop?

Postby bjornmu on Fri Jan 25, 2013 2:52 am

But that won't open a terminal window. Or will the desktop sniff that it is a script and run it in a terminal for you? I think it shouldn't so it probably doesn't.

The terminal (mate-terminal at least, as well as the old xterm) can take an argument -e <command> to run a command in the terminal. I tried mate-terminal -e ssh <host> but it terminated immediately for some reason. xterm worked though, but you may have to install xterm as it's not in Mint by default (not in mine anyway)
User avatar
Level 3
Level 3
Posts: 159
Joined: Wed Dec 19, 2012 2:50 am
Location: Trondheim, Norway

Return to Newbie Questions

Who is online

Users browsing this forum: PeterRJG, prestonR, xGuy and 23 guests