Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Basically, I have the code I need to run the thread to start my Minecraft server in an executable text file. When I click it, it asks me what I want to do with it: Run In Terminal, Display or just Run.

Because I want to create a link to it and then put that link in Docky, I need a way of setting it to Run In Terminal by default. I found a way to make it Run by default, but I need to run it in terminal.

share|improve this question
up vote 2 down vote accepted

Open the Dash and search for Main Menu. (It's in the Software Center if it's not installed.) Open it and create a new item. Type in the name you want it to have, then type in the command line:

gnome-terminal -x executable_text_file_path/and_name

For instance, I have a Shell Script folder in my Home folder. To run one of them in Terminal, I would type in...

gnome-terminal -x "Shell Scripts/"

I only used the quotation marks because I have spaces in the names. If you have no spaces, you don't need the quotation marks.

You should now be able to go to the Dash and type in the name you gave your program. A single click on it will start it in Terminal mode - or just drag it to your Launcher!

share|improve this answer
Is main menu a XML file? That's what my system came up with. It also found a xib file. – Seth Feb 4 '13 at 1:14
Sorry. You can start it with the command "alacarte" in the terminal if you like. It's a Python script. – Dale Feb 4 '13 at 3:17

As this file is executable, it's by default treated as such. You are asked to run or open it, as a feature of Nautilus (the file browser). When creating a shortcut to it, simply make a shortcut to an application (an executable), and select your script file. This will run the file instead of opening it.

On the other hand, if you wanted to make a shortcut to opening this file, you would select gedit (or any editor you like) as the executable, and pass the path to your script as an argument.

share|improve this answer
But I want it to execute IN TERMINAL by default. I can make it run by default, but I need to code to come up in the terminal. – schtocker Feb 3 '13 at 21:47
Alright, then let the shortcut launch the terminal, using your script as an argument. For example gnome-terminal -e /path/to/script will launch the script in a standard gnome terminal. – Rafał Cieślak Feb 3 '13 at 22:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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