How do I make a link work and insert it into 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
RobHK

How do I make a link work and insert it into menu?

Post by RobHK »

I installed a program (called TMXValidator) from a BIN file. It installed into a folder TMXValidator in my personal home directory, but no menu item was created. I found the folder and was able to run the program by clicking on the file TMXValidator.sh.

I then created a link to this file. The link was created in the same folder. I tested it and it ran the program. I then moved the link to the desktop, and it would no longer run the program. It opens the Run dialog but does not respond when I click Run.

I opened the link in a text editor and saw:

#!/bin/sh
#/*******************************************************************************
# * Copyright (c) 2005, 2006 Maxprograms
# * All rights reserved. This program and the accompanying materials
# * are made available under the terms of the Eclipse Public License v1.0
# * which accompanies this distribution, and is available at
# * http://www.eclipse.org/legal/epl-v10.html
# *
# * Contributors:
# * Rodolfo M. Raya - initial API and implementation
# * Geraldine Lin - Chinese translations
# *******************************************************************************/

CP="/home/robin/TMXValidator/lib/tmx.jar:/home/robin/TMXValidator/lib/jdom.jar:/home/robin/TMXValidator/lib/xercesImpl.jar:/home/robin/TMXValidator/lib/xml-apis.jar:/home/robin/TMXValidator/lib/resolver.jar:/home/robin/TMXValidator/lib/GTK/swt.jar"
java -Xmx999M -cp $CP com.maxprograms.gui.TMXValidatorGUI $1 $2 $3 $4 $5 $6


I'd be grateful if someone couldhelp me to:
- get the link to run from the desktop
- insert the item in the main menu

TIA

Rob
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.
Husse

Re: How do I make a link work and insert it into menu?

Post by Husse »

That looks a bit hard to decifer
Make a new link from the desktop
This should also work in the menu
(I don't really know what kind of link you made....)
RobHK

Re: How do I make a link work and insert it into menu?

Post by RobHK »

Husse wrote:That looks a bit hard to decifer
Make a new link from the desktop
This should also work in the menu
(I don't really know what kind of link you made....)
How do I make a link from the desktop? I made the original link by right-clicking on the program icon in its folder and it was automatically created in the same folder. I copied it to the desktop and it no longer ran, though I could open the Run dialog.
I can't understand the detail of the link script, but I can see that the full path is in the link, not a relative path.
MagnusB
Level 6
Level 6
Posts: 1252
Joined: Sun Nov 18, 2007 12:39 pm
Location: Norway

Re: How do I make a link work and insert it into menu?

Post by MagnusB »

Make a launcher on the desktop, and move the file back to the original folder, as it is probably symlinked to something.
Then make the desktop launcher run the file: sh /path/to/file/here
Image
You're not drunk if you can lie on the floor without holding on.
--Dean Martin
Husse

Re: How do I make a link work and insert it into menu?

Post by Husse »

the full path is in the link
Both yes and no if I read it right, but MagnusB's suggestion should work
RobHK

Re: How do I make a link work and insert it into menu?

Post by RobHK »

I right-clicked the desktop and opened the dialog box. I entered a name and then browsed to the file which runs the program (/home/robin/TMXValidator/tmxvalidator.sh). The desktop icon was created, but when I click on it nothing happens. No Run dialog box appears, unlike my problem with the link created in the program folder, which -- when moved to the Desktop -- would still open the Run dialog, but would not run the program.


This is what the link looks like if opened in a text editor:
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=TMXValidator
Type=Application
Terminal=false
Icon[en_GB]=gnome-panel-launcher
Exec=/home/robin/TMXValidator/tmxvalidator.sh
Name[en_GB]=TMXValidator

Icon=gnome-panel-launcher
GenericName[en_GB]=
Husse

Re: How do I make a link work and insert it into menu?

Post by Husse »

Terminal=false
What if Terminal=true ?
RobHK

Re: How do I make a link work and insert it into menu?

Post by RobHK »

Husse wrote:
Terminal=false
What if Terminal=true ?
It opens a terminal which immediately closes. Just time to get the beginning of a multi-line error message beginning "Error in...". Seems logical.
Husse

Re: How do I make a link work and insert it into menu?

Post by Husse »

Look a this
CP="/home/robin/TMXValidator/lib/tmx.jar:/home/robin/TMXValidator/lib/jdom.jar:/home/robin/TMXValidator/lib/xercesImpl.jar:/home/robin/TMXValidator/lib/xml-apis.jar:/home/robin/TMXValidator/lib/resolver.jar:/home/robin/TMXValidator/lib/GTK/swt.jar"
java -Xmx999M -cp $CP com.maxprograms.gui.TMXValidatorGUI $1 $2 $3 $4 $5 $6
There is no path here
CP com.maxprograms.gui.TMXValidatorGUI
If you added the path it might work. The path would be /home/robin/ I guess
RobHK

Re: How do I make a link work and insert it into menu?

Post by RobHK »

Husse wrote:Look a this
CP="/home/robin/TMXValidator/lib/tmx.jar:/home/robin/TMXValidator/lib/jdom.jar:/home/robin/TMXValidator/lib/xercesImpl.jar:/home/robin/TMXValidator/lib/xml-apis.jar:/home/robin/TMXValidator/lib/resolver.jar:/home/robin/TMXValidator/lib/GTK/swt.jar"
java -Xmx999M -cp $CP com.maxprograms.gui.TMXValidatorGUI $1 $2 $3 $4 $5 $6
There is no path here
CP com.maxprograms.gui.TMXValidatorGUI
If you added the path it might work. The path would be /home/robin/ I guess
No, it doesn't change anything.

But it's not really what we are looking to do, is it? We are looking at how to create a link that works through the GUI.
Locked

Return to “Beginner Questions”