How do I start a terminal program from the start menu?

Quick to answer questions about finding your way around Linux Mint as a new user.
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. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
ChrisHvide
Level 1
Level 1
Posts: 47
Joined: Tue Aug 29, 2017 8:08 pm

How do I start a terminal program from the start menu?

Post by ChrisHvide »

Hi there.
I need to open a node.js script with the terminal from the start menu.
I tried this, which doesn't work:
mate-terminal -e "node /home/chris/.SMLoadr/SMLoadr.js"
Any idea how I can do this?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
System: Intel© Core™ i9-10900K CPU @ 3.70GHz × 10
NVIDIA Corporation GA104M [GeForce RTX 3080]
ChrisHvide
Level 1
Level 1
Posts: 47
Joined: Tue Aug 29, 2017 8:08 pm

Re: How do I start a terminal program from the start menu?

Post by ChrisHvide »

BUMP
System: Intel© Core™ i9-10900K CPU @ 3.70GHz × 10
NVIDIA Corporation GA104M [GeForce RTX 3080]
User avatar
Flemur
Level 20
Level 20
Posts: 10097
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: How do I start a terminal program from the start menu?

Post by Flemur »

ChrisHvide wrote: Sun May 20, 2018 8:59 pmI tried this, which doesn't work:
mate-terminal -e "node /home/chris/.SMLoadr/SMLoadr.js"
Any idea how I can do this?
It sounds simple, and it should be simple, but it's a bit of a PITA.

For instance...
File "aaa" is executable and in my PATH, and is:

Code: Select all

echo $HOME
ls -l $HOME

Code: Select all

xfce4-terminal -e="aaa"
--> nothing happens; no terminal flashes up.

Change aaa to

Code: Select all

echo $HOME
ls -l $HOME
read 
and another terminal pops up with $HOME shown and the "ls" output is shown. Pretty lame, huh?
It works if the script puts up a GUI (content of aaa = "gimp"), or waits for input...

Edit:
https://askubuntu.com/questions/484993/ ... nal-window
There's

Code: Select all

xfce4-terminal  --hold -e="aaa"
which leaves the new window up til you close it, but there's no output from the "aaa" command w/o the 'read' at the end. Pretty lame, huh?

So here's my free advice: make a two-line executable script in your PATH (call it "doit")

Code: Select all

node /home/chris/.SMLoadr/SMLoadr.js
read
Then try

Code: Select all

mate-terminal -e "doit"
Or you could play with the ludicrous -x sh -c "!!; bash syntax at that link.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
ChrisHvide
Level 1
Level 1
Posts: 47
Joined: Tue Aug 29, 2017 8:08 pm

Re: How do I start a terminal program from the start menu?

Post by ChrisHvide »

Ah of course I can do it like that.
Thank you so much :)
System: Intel© Core™ i9-10900K CPU @ 3.70GHz × 10
NVIDIA Corporation GA104M [GeForce RTX 3080]
User avatar
cabbagetreemo
Level 3
Level 3
Posts: 147
Joined: Fri Mar 31, 2017 2:36 am
Location: Spain

Re: How do I start a terminal program from the start menu?

Post by cabbagetreemo »

Another method, which worked on Cinnamon is to create a bash file /path/to/your/bash/file which executes your terminal commands. Make it executable

Code: Select all

chmod u=rwx /path/to/your/bash/file
and then create a file in /usr/share/application/<name>.desktop where <name> can be whatever you want

The contents of the file should look like

Code: Select all

[Desktop Entry]
Encoding=UTF-8
Exec=/path/to/your/bash/file
Icon=/path/to/an/image #(A path to a .png file which will supply the icon in the menu)
Type=Application
Terminal=false
Comment= #I think you can put more or less anything here, something descriptive would be good
Name= #The name you want to appear in the menu
GenericName= #I don't think this matters
StartupNotify=false
Categories= #Which ever submenu is appropriate e.g. Office
Locked

Return to “Beginner Questions”