You could create a launcher for the script. You would be able to run the script from the activities menu in GNOME (click it) and from the directory the file is saved in. This would be a .desktop file. e.g. Example.desktop:
[Desktop Entry]
Name=Example
Exec=/path/to/executable_script
StartupNotify=true
Terminal=true
Type=Application
Icon=/optional/path/to/icon.png
Make the file executable. When placed in /usr/share/applications or ~/.local/share/applications, GNOME will add the .desktop file to the activities menu.
Now you just have to click the launcher in the activities menu and your script will run. The terminal will close after the script has run to its end.
chmod +x
a file, as long as the file system can store the data correctly (ie. a native file-system), the execute permission will be set, and double-clicking on the file will attempt execute. I just created a file.sh,chmod +x
, then in my preferredpcmanfm-qt
a double-click of it asks if I want to run in terminal (I answer yes & it runs). If i usethunar
(my second favorite) it'll open in an editor -- using a different file manager may be all you need. (note: I'm using pcmanfm-qt & thunar as examples; I'm running Lubuntu, but also like Xubuntu - hence those choices) – guiverc Apr 26 '19 at 12:25nautilus
, and it's doing whatthunar
did on my 19.04 box (opened in an editor;gedit
probably in your case & it was something else in mine). I openednautilus
(Files it is called within gnome menus) & I didn't see any way to make nautilus do what you want (but I'm not a gnome person, so rarely use it & others may have ideas I've not discovered if you wait). My answer was to try another File.Manager/File.Browser. I trieddolphin
and it too has a "Run in Konsole" option (Konsole is the KDE terminal) – guiverc Apr 26 '19 at 12:43