adding a script to the menu - how do I?

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

adding a script to the menu - how do I?

Postby goldstar1 on Mon Dec 22, 2008 12:42 am

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

Linux Mint is funded by ads and donations.
 

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

Postby Fred on Mon Dec 22, 2008 1:14 am

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
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

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

Postby goldstar1 on Mon Dec 22, 2008 2:31 am

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.
goldstar1
Level 2
Level 2
 
Posts: 70
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?

Postby Fred on Mon Dec 22, 2008 12:31 pm

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
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

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

Postby goldstar1 on Mon Dec 22, 2008 7:36 pm

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!
goldstar1
Level 2
Level 2
 
Posts: 70
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?

Postby Fred on Mon Dec 22, 2008 8:05 pm

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
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

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

Postby goldstar1 on Mon Dec 22, 2008 8:47 pm

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: 70
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?

Postby goldstar1 on Mon Dec 22, 2008 9:11 pm

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
goldstar1
Level 2
Level 2
 
Posts: 70
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?

Postby Fred on Tue Dec 23, 2008 7:23 pm

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
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

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

Postby goldstar1 on Tue Dec 23, 2008 7:42 pm

Good point...Excellent point actually...Thank you again!
goldstar1
Level 2
Level 2
 
Posts: 70
Joined: Mon Aug 20, 2007 11:32 pm
Location: On the coast of Southern California USA

Linux Mint is funded by ads and donations.
 

Return to Newbie Questions

Who is online

Users browsing this forum: Bing [Bot] and 34 guests