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

All Gurus once were Newbies
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. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
ChrisHvide
Level 1
Level 1
Posts: 36
Joined: Tue Aug 29, 2017 8:08 pm

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

Post by ChrisHvide » Sun May 20, 2018 8:59 pm

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?
System: Host: chris-MS-7916 Kernel: 4.13.0-32-generic x86_64 (64 bit)
Desktop: MATE 1.18.0 Distro: Linux Mint 18.3 Sylvia

ChrisHvide
Level 1
Level 1
Posts: 36
Joined: Tue Aug 29, 2017 8:08 pm

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

Post by ChrisHvide » Mon May 21, 2018 9:07 am

BUMP
System: Host: chris-MS-7916 Kernel: 4.13.0-32-generic x86_64 (64 bit)
Desktop: MATE 1.18.0 Distro: Linux Mint 18.3 Sylvia

User avatar
Flemur
Level 16
Level 16
Posts: 6118
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 » Mon May 21, 2018 9:33 am

ChrisHvide wrote:
Sun May 20, 2018 8:59 pm
I 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?
Mint 18.3 Xfce/fluxbox/pulse-less
Xubuntu 17.10/fluxbox/pulse-less

ChrisHvide
Level 1
Level 1
Posts: 36
Joined: Tue Aug 29, 2017 8:08 pm

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

Post by ChrisHvide » Mon May 21, 2018 12:28 pm

Ah of course I can do it like that.
Thank you so much :)
System: Host: chris-MS-7916 Kernel: 4.13.0-32-generic x86_64 (64 bit)
Desktop: MATE 1.18.0 Distro: Linux Mint 18.3 Sylvia

User avatar
cabbagetreemo
Level 1
Level 1
Posts: 49
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 » Wed May 23, 2018 7:42 pm

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

Post Reply

Return to “Newbie Questions”