adding a script to the menu - how do I?

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
goldstar1
Level 2
Level 2
Posts: 69
Joined: Mon Aug 20, 2007 11:32 pm
Location: On the coast of Southern California USA

adding a script to the menu - how do I?

Post by goldstar1 »

I purchased a book "Practical PHP and MySQL" by Jono Bacon --- cool stuff that I would like to get under my belt. Through this book, there's a program called XAMPP that I downloaded and installed.

There's a 'xampp-control-panel' that gets started by running this script...

$ cd /opt/lampp/share/xampp-control-panel

then...

$ sudo ./xampp-control-panel

I would like to be able to start this "control-panel" from the 'Menu'

right click 'Menu' >> "Edit menu' >> Administration >> 'New Item" button >> WHAT DO I PLACE IN THE COMMAND WINDOW?

Thank You
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.
Fred

Re: adding a script to the menu - how do I?

Post by Fred »

goldstar1,

There a number of ways to go about this depending on what you needs and desires are. I would probably do the below.

Set the file permissions with:

sudo chmod 755 /opt/lampp/share/xampp-control-panel


Copy to /usr/local/bin with:

sudo cp -a /opt/lampp/share/xampp-control-panel /usr/local/bin

Use "xampp-control-panel" without the quotes as the command to start.

Fred
goldstar1
Level 2
Level 2
Posts: 69
Joined: Mon Aug 20, 2007 11:32 pm
Location: On the coast of Southern California USA

Re: adding a script to the menu - how do I?

Post by goldstar1 »

Thanks for your quick reply.

I did this just now and that didn't work. Nothing happens when I click on the menu item.

Here in California it's like my bed time. I'll continue with this tomarrow.
Fred

Re: adding a script to the menu - how do I?

Post by Fred »

goldstar1,

Try putting it in /usr/bin instead of /usr/local/bin
I don't know what has been done with the paths on the new release.

sudo cp -a /opt/lampp/share/xampp-control-panel /usr/bin

Fred
goldstar1
Level 2
Level 2
Posts: 69
Joined: Mon Aug 20, 2007 11:32 pm
Location: On the coast of Southern California USA

Re: adding a script to the menu - how do I?

Post by goldstar1 »

That didn't work either

I tried...
Desktop $ sudo cp -a /opt/lampp/share/xampp-control-panel/xampp-control-panel /usr/local/bin /usr/bin

then from command window
/usr/local/bin and sh /usr/local/bin
then
/usr/bin and sh /usr/bin
then
/usr/local/bin/xampp-control-panel and sh /usr/local/bin/xampp-control-panel
then
both /usr/local/bin and /usr/bin /xampp-control-panel

I got that 'sh' part from an Ubuntu forum from google --- I even tried a script which didn't work

Yes from a console I can type

Desktop $ cd /opt/lampp/share/xampp-control-panel

then...

/opt/lampp/share/xampp-control-panel $ sudo ./xampp-control-panel

and there it is with all its Glory!
Fred

Re: adding a script to the menu - how do I?

Post by Fred »

goldstar1,

ok... let's start over here. I think I see the problem. Do you have a folder called "xampp-control-panel" and in that folder you have a file called "xampp-control-panel"? If you do, that is where I went wrong.

If that is what you have then open a terminal and:

sudo chmod 755 /opt/lampp/share/xampp-control-panel/xampp-control-panel

Then in a terminal:

sudo cp -a /opt/lampp/share/xampp-control-panel/xampp-control-panel /usr/bin

Now... type in a terminal:

xampp-control-panel

and it should run. That should also be the command to put in the launcher.

Fred
goldstar1
Level 2
Level 2
Posts: 69
Joined: Mon Aug 20, 2007 11:32 pm
Location: On the coast of Southern California USA

Re: adding a script to the menu - how do I?

Post by goldstar1 »

The response I get from the console is 'You must be root to launch xampp-control-panel'

The permissions set are 777
goldstar1
Level 2
Level 2
Posts: 69
Joined: Mon Aug 20, 2007 11:32 pm
Location: On the coast of Southern California USA

<SOLVED> adding a script to the menu - how do I?

Post by goldstar1 »

Here I finally found my answer and it works

http://ubuntuforums.org/showthread.php?t=223410

Maybe this should be a sticky

anyway..thanks so much for your help Fred...you did lead me on the right direction
Fred

Re: adding a script to the menu - how do I?

Post by Fred »

goldstar1,

Just as a matter of information. It is always a bad idea to run a GUI program as root. A well behaved program should run in a user account. Be wary of a program that requires root privileges to operate correctly. This is the kind of thing that causes Windows to be so insecure.

Fred
goldstar1
Level 2
Level 2
Posts: 69
Joined: Mon Aug 20, 2007 11:32 pm
Location: On the coast of Southern California USA

Re: adding a script to the menu - how do I?

Post by goldstar1 »

Good point...Excellent point actually...Thank you again!
Locked

Return to “Beginner Questions”