[SOLVED] new menu item not working

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
Fizz
Level 2
Level 2
Posts: 55
Joined: Mon Jul 15, 2019 8:17 am

[SOLVED] new menu item not working

Post by Fizz » Fri Aug 30, 2019 8:42 pm

Hi all-

I am using Mint 19.1 Cinnamon. I have installed the Unigine Heaven benchmark. I have manually created a new menu item for it, but it won't launch from there, and i don't know why. The program does run properly when run from a command prompt.

Does anyone know why this doesn't work and how i can fix it? Thanks!

-Fizz
Last edited by Moem on Sat Sep 07, 2019 2:04 am, edited 1 time in total.
Reason: Marked this as [SOLVED] for you; please note that you can and should do this for your own topics. Thanks!

User avatar
kc1di
Level 14
Level 14
Posts: 5405
Joined: Mon Sep 08, 2008 8:44 pm
Location: Maine USA

Re: new menu item not working

Post by kc1di » Sat Aug 31, 2019 6:49 am

Hi Fizz,
Please post what command you used to launch the program and did you exactly copy that command into the menu Item you created?
How did you create the menu Item?
Easy tips : https://easylinuxtipsproject.blogspot.com/
Linux Mint Installation Guide: http://linuxmint-installation-guide.rea ... en/latest/
Registered Linux User #462608

Fizz
Level 2
Level 2
Posts: 55
Joined: Mon Jul 15, 2019 8:17 am

Re: new menu item not working

Post by Fizz » Sat Aug 31, 2019 9:18 am

Hi-

The exact command is: /home/me/Unigine_Heaven-4.0/heaven

When i copy/paste that from the menu into a command prompt, it launches correctly.

The menu item was created manually through the menu: right-click on the Mint icon, configure / Menu / Open Menu Editor , and then New Item under games. I give it a name "Heaven Benchmark", and copy the command line above into the Command field, where i get the checkmark indicating that it is valid.

I have tried this both with "Launch in Terminal" checked and unchecked. I have also tried recreating the item by copying a menu item that does work, and then modifying the command. But that didn't help either.

-Fizz

Fizz
Level 2
Level 2
Posts: 55
Joined: Mon Jul 15, 2019 8:17 am

Re: new menu item not working

Post by Fizz » Mon Sep 02, 2019 11:05 am

No other advice? Has no one else had this issue?

-Fizz

oldgranola
Level 4
Level 4
Posts: 359
Joined: Fri Sep 05, 2014 1:39 am

Re: new menu item not working

Post by oldgranola » Thu Sep 05, 2019 12:43 am

I'll bite. I just got desktop launchers working myself after they stopped working in Cinnamon. Sometimes I can say for some programs using the same command line in a bash shell doesnt' work in the launcher. Latest Tor browser is a good example. It took me a bit to learn I had to point to a python script called tor-launcher even though I could launch the browser directly in bash shell. Not at all sure why, was hoping to see some OG's speek up but not so my two half cents.
comadore, pcDOS, hpux, solaris, vms-vax ....blah blah blah..
Yet I'm still a fn nooob

decrepit
Level 4
Level 4
Posts: 202
Joined: Mon Dec 03, 2018 4:07 am

Re: new menu item not working

Post by decrepit » Thu Sep 05, 2019 1:06 am

I'm using mate not Cinnamon, But I found a similar thing, the launcher needs to point to the command, not have the command in it. Also of course the command text, permissions needs to be set to execute.

User avatar
kc1di
Level 14
Level 14
Posts: 5405
Joined: Mon Sep 08, 2008 8:44 pm
Location: Maine USA

Re: new menu item not working

Post by kc1di » Thu Sep 05, 2019 4:06 am

How did you install the program?

You may have to manually create at .desktop file in /usr/share/applications folder.
Here's how to do that.

https://www.maketecheasier.com/create-d ... ile-linux/
Easy tips : https://easylinuxtipsproject.blogspot.com/
Linux Mint Installation Guide: http://linuxmint-installation-guide.rea ... en/latest/
Registered Linux User #462608

Fizz
Level 2
Level 2
Posts: 55
Joined: Mon Jul 15, 2019 8:17 am

Re: new menu item not working

Post by Fizz » Thu Sep 05, 2019 6:24 pm

decrepit wrote:
Thu Sep 05, 2019 1:06 am
I'm using mate not Cinnamon, But I found a similar thing, the launcher needs to point to the command, not have the command in it. Also of course the command text, permissions needs to be set to execute.
I don't know what this means. I do have the program set to be executable. And it does run from the command line. So when you say "point to the command, not have the command in it", what do you mean?

I have it set up like other links. For example, the Superposition benchmark does work, and I have it pointing to the executable. But in that case, the installer set up the link itself. For Heaven, i have set up the link. I had also set up a manual link for Anaconda Navigator, and it works fine. I just can't figure out what the difference is with this one.


Fizz
Last edited by Fizz on Thu Sep 05, 2019 7:30 pm, edited 1 time in total.

Fizz
Level 2
Level 2
Posts: 55
Joined: Mon Jul 15, 2019 8:17 am

Re: new menu item not working

Post by Fizz » Thu Sep 05, 2019 6:38 pm

kc1di wrote:
Thu Sep 05, 2019 4:06 am
How did you install the program?
It came as a downloadable .run file. I ran that, and it did the rest. But one thing it doesn't do is add an entry to the launcher menu.
You may have to manually create at .desktop file in /usr/share/applications folder. Here's how to do that.
https://www.maketecheasier.com/create-d ... ile-linux/
I will look into this. Though parts of it don't seem relevant. It discusses extracting from an archive, but i don't have that. All i have is an executable file. Apologies if i am missing something here- this is the newbie section and i certainly am one. Heh.


-Fizz

decrepit
Level 4
Level 4
Posts: 202
Joined: Mon Dec 03, 2018 4:07 am

Re: new menu item not working

Post by decrepit » Thu Sep 05, 2019 8:58 pm

Fizz wrote:
Thu Sep 05, 2019 6:24 pm

I don't know what this means. I do have the program set to be executable. And it does run from the command line. So when you say "point to the command, not have the command in it", what do you mean?

I have it set up like other links. For example, the Superposition benchmark does work, and I have it pointing to the executable. But in that case, the installer set up the link itself. For Heaven, i have set up the link. I had also set up a manual link for Anaconda Navigator, and it works fine. I just can't figure out what the difference is with this one.


Fizz
What I had to do was save the command as a text file. then in the launcher the text files address.
So here's my launcher, to FTW.

Code: Select all

/home/mike/genealogy/FTW_start.sh 
And here's that run command.

Code: Select all

FTW_start.sh
If I just put the above command in the launcher it wouldn't work




[/code]

User avatar
AndyMH
Level 9
Level 9
Posts: 2624
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: new menu item not working

Post by AndyMH » Fri Sep 06, 2019 3:11 am

If I just put the above command in the launcher it wouldn't work
Because FTW_start.sh in not in your path, so when mint searches for the command it can't find it. You can see your path with echo $PATH, e.g.

Code: Select all

andy@T430 ~ $ echo $PATH
/home/andy/bin:/home/andy/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
If you want to add folders to the path, seach the web, this is just one:
https://www.techrepublic.com/article/ho ... -in-linux/
Homebrew i5-8400+GTX1080 Cinnamon 19.0, 3 x Thinkpad T430 Cinnamon 19.0, i7-3632 , i5-3320, i5-3210, Thinkpad T60 19.0 Mate

User avatar
pbear
Level 8
Level 8
Posts: 2397
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: new menu item not working

Post by pbear » Fri Sep 06, 2019 3:49 am

Fizz wrote:
Sat Aug 31, 2019 9:18 am
The menu item was created manually through the menu: right-click on the Mint icon, configure / Menu / Open Menu Editor , and then New Item under games. I give it a name "Heaven Benchmark", and copy the command line above into the Command field, where i get the checkmark indicating that it is valid.
Been a while since I did this, but try right-click on the desktop, select "Create a new launcher here ... " and fill in the fields there. Use the form of command exactly as you run it in Terminal. No need to tick the box. Click OK. You'll get a desktop icon, then be asked whether to add to Menu; say "Yes." It's originally added to the Other category, but you can change that later with Menu Editor. If you don't want to keep the desktop launcher, it can be deleted and the Menu entry will remain. If you want a launcher on Panel, right-click the Menu entry to get that option.

Hope that helps. Sorry if I've forgotten some important detail. Good luck.
Last edited by pbear on Fri Sep 06, 2019 4:12 am, edited 1 time in total.
Time flies like an arrow. Fruit flies like a banana.
If your problem has been solved, please edit the thread title.

decrepit
Level 4
Level 4
Posts: 202
Joined: Mon Dec 03, 2018 4:07 am

Re: new menu item not working

Post by decrepit » Fri Sep 06, 2019 5:57 am

AndyMH wrote:
Fri Sep 06, 2019 3:11 am
If I just put the above command in the launcher it wouldn't work
Because FTW_start.sh in not in your path, so when mint searches for the command it can't find it. You can see your path with echo $PATH, e.g.

Code: Select all

andy@T430 ~ $ echo $PATH
/home/andy/bin:/home/andy/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
If you want to add folders to the path, seach the web, this is just one:
https://www.techrepublic.com/article/ho ... -in-linux/
So /home/mike/genealogy/FTW_start.sh isn't in my path? That's weird.

And it's working great, with the command address in the launcher.

Fizz
Level 2
Level 2
Posts: 55
Joined: Mon Jul 15, 2019 8:17 am

Re: new menu item not working

Post by Fizz » Fri Sep 06, 2019 7:54 am

pbear wrote:
Fri Sep 06, 2019 3:49 am
Been a while since I did this, but try right-click on the desktop, select "Create a new launcher here ... " and fill in the fields there. Use the form of command exactly as you run it in Terminal. No need to tick the box. Click OK. You'll get a desktop icon, then be asked whether to add to Menu; say "Yes." It's originally added to the Other category, but you can change that later with Menu Editor. If you don't want to keep the desktop launcher, it can be deleted and the Menu entry will remain. If you want a launcher on Panel, right-click the Menu entry to get that option.
Thanks for the detailed instructions. Unfortunately, still no luck. I successfully created the desktop icon, and i used the exact command (the same one that does work from Terminal), but it still won't launch, either from the desktop icon or through the menu. The only way it launches is through Terminal.

What the heck is up with this file?

-Fizz

User avatar
pbear
Level 8
Level 8
Posts: 2397
Joined: Wed Jun 21, 2017 12:25 pm
Location: San Francisco

Re: new menu item not working

Post by pbear » Fri Sep 06, 2019 2:09 pm

Fizz wrote:
Fri Sep 06, 2019 7:54 am
What the heck is up with this file?
What happens if you open Terminal and run only heaven? If nothing, take another look at Andy's post, above.
Time flies like an arrow. Fruit flies like a banana.
If your problem has been solved, please edit the thread title.

User avatar
roblm
Level 11
Level 11
Posts: 3566
Joined: Sun Feb 24, 2013 2:41 pm

Re: new menu item not working

Post by roblm » Fri Sep 06, 2019 3:14 pm

Fizz,

Try this method, which worked when I tested it.

Open /home/me/Unigine_Heaven-4.0 (assuming me is your user name). Create a document named start-heaven or whatever.

Add these lines:

Code: Select all

#!/bin/sh

cd /home/me/Unigine_Heaven-4.0

/home/me/Unigine_Heaven-4.0/heaven
Right click on the script and select Properties > Permissions. Mark the checkbox next to Allow executing file as program.

Open the Menu Editor and create a New Item. For the command, use this:
sh /home/me/Unigine_Heaven-4.0/start-heaven

Fizz
Level 2
Level 2
Posts: 55
Joined: Mon Jul 15, 2019 8:17 am

Re: new menu item not working

Post by Fizz » Fri Sep 06, 2019 10:23 pm

pbear wrote:
Fri Sep 06, 2019 2:09 pm
Fizz wrote:
Fri Sep 06, 2019 7:54 am
What the heck is up with this file?
What happens if you open Terminal and run only heaven? If nothing, take another look at Andy's post, above.
Running just heaven returns command not found. ./heaven works though. This puzzles me though- i thought you could always run a program from the current working directory, without it expressly needing to be in the path. I guess that's not the case (was it ever- is my thought a Windows-centric concept?). Also, how does one modify the PATH directly (in case i wanted to remove a directory, or somesuch)?

-Fizz

Fizz
Level 2
Level 2
Posts: 55
Joined: Mon Jul 15, 2019 8:17 am

Re: new menu item not working

Post by Fizz » Fri Sep 06, 2019 10:34 pm

roblm wrote:
Fri Sep 06, 2019 3:14 pm
Try this method, which worked when I tested it.
Open /home/me/Unigine_Heaven-4.0 (assuming me is your user name). Create a document named start-heaven or whatever.
Add these lines:

Code: Select all

#!/bin/sh
cd /home/me/Unigine_Heaven-4.0
/home/me/Unigine_Heaven-4.0/heaven
Right click on the script and select Properties > Permissions. Mark the checkbox next to Allow executing file as program.
Open the Menu Editor and create a New Item. For the command, use this:
sh /home/me/Unigine_Heaven-4.0/start-heaven
Ah, ok, this works!

I don't know if i like this method more or less than the previous suggestion of the PATH modification, but at least now i have some options to make these sorts of things work. And it's helping me to understand the shell better.

Thanks to all for the feedback and help. Now i can move onto other questions. :)

-Fizz

Post Reply

Return to “Newbie Questions”