1

this question is simple about "Open/Run in Terminal"....

Looks Ubunutu doesn't support bash/shell-scripts the way we know from KDE and any other OS:

I tried the obvious:

  1. Right click in file manager
  2. Open with other Application...
  3. Show all applications

but there is no Terminal application listed, only "Find Online Applications". You can't even browse for a new application as you would do in any other OS.

Any ideas? I found only hacks like creating a launcher item but that's far from a solution or ideal.

To make it really clear:

I want to run any bash script accessible with the file manager via right-click, "Open with" -> "Terminal" so i can see the output. Its really like double click on a batch file under Windows and it just runs the bloody script, not closing the terminal except I wrote so in the script. So finally this is NOT about double click to run, its about the running the script through context menu as said in the title already!

thanks!

Ubuntu-x64-14.04/Unity/No Mods or tweaks.

5
  • I haven't used KDE in more than a decade. How does that offer shell scripts? Which shell scripts does it show? Things in your ~/bin? Anywhere in your $PATH? Do you just want to be able to run scripts in a terminal by double clicking on them?
    – terdon
    Mar 25, 2015 at 19:42
  • any bash script accessible with the file manager via right-click, "Open with" -> "Terminal" so i can see the output. Its really like double click on a batch file under Windows and it just runs the bloody script, not closing the terminal. Mar 25, 2015 at 19:45
  • OK, what desktop environment are you using? Is this for Unity? Please edit your question and include both the clarification from your previous comment and your desktop environment in the body of your question.
    – terdon
    Mar 25, 2015 at 19:46
  • Terminal is not listed because terminals don't run files, shells do - and terminals run shells.
    – muru
    Mar 25, 2015 at 19:52
  • I followed the instructions of the mentioned duplicate but no, neither "Run in Terminal" or "Run" opens and runs the script in the terminal. Mar 25, 2015 at 20:01

1 Answer 1

2

The clean way would be to create a .desktop file for your script and then make it the default text editor.

  1. Create a file called /usr/share/applications/openscript.desktop with the following contents:

    [Desktop Entry]
    Name=Open script in terminal
    Exec=gnome-terminal -e "%U"
    Terminal=false
    Type=Application
    MimeType=text/plain;
    

Then, do these steps:

  • Log out/in (I don't know if it's necessary)
  • Right click on the file
  • Click on Open with...
  • Click on Another app...
  • Select "Open script in terminal"
  • You're done!
4
  • thats really impossible to explain a client to do these steps but I take it! Thanks! Mar 25, 2015 at 20:14
  • I'm not sure if it works, test it. However I think that you can automate the process for your client.
    – 0x2b3bfa0
    Mar 25, 2015 at 20:17
  • works perfect! thank you, just wished this OS would know its own tools and enables this by default... Mar 29, 2015 at 1:00
  • How would this work with the unity desktop manager?
    – paul23
    Mar 18, 2018 at 2:01

You must log in to answer this question.

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