0

GNOME Terminal not showing in list of applications to open a file with. I'd like to be able to call it from another app to execute a batch (.sh type) file.
OS - Ubuntu 18.04.

List of Applications:
List of Applications

The GNOME Terminal is definitely installed and runs on my system when I launch it from Favourites etc.

There are two other issues that may be related. I also noticed in the list of applications presented a duplication e.g of File Manager etc. In addition I have a crash report log related to the GNOME desktop. I submitted the report but don't know what else to do with it.

pomsky
  • 68,507

1 Answers1

0

Interesting question, I believe an 'open with Terminal' option (to execute a script) is not there by default, but you can certainly create one. To do this follow the steps below.

  1. Create an empty text file in your ~/.local/share/applications/ directory.
  2. Open it with a text editor.
  3. Add the following lines to it.

    [Desktop Entry]
    Name=Open with Terminal
    Comment=Run the script in a Terminal window
    Exec=/bin/bash -c '%U; exec bash'
    Type=Application
    Terminal=true
    Icon=utilities-terminal
    NoDisplay=true
    
  4. Save the text file (or rename it) with a .desktop suffix, say as open-with-terminal.desktop.

Now you should find an entry called 'Open with Terminal' in the 'Open with Other Application' dialog.

But this might be an overkill for your actual goal. If you just want to execute a script from your file manager, then see this: How do I run executable scripts in Nautilus?

pomsky
  • 68,507
  • Thank you very much @pomsky ! It worked like a charm :) . I had created .desktop files for GNOME Terminal. I just didn't know that these need to be placed in the ~/.local/share/applications. Thanks for the link to running scripts in Nautilus. I had looked into FireSSH ( no longer available) and shellinabox. I didn't have much luck with shellinabox. Running another web server to monitor a local web server is definitely an overkill. I managed to learn to log in with SSH in the process though :) Thank you once again for your outstanding help. – BlackBeardie May 19 '20 at 22:05