Feedback

type to search

How would I run a ruby script from the panel?

Asked by
I have a small Ruby script that I can run successfully from the command line:

rvm ree ruby ~/scripts/backup.rb


The “rvm ree” is present because I’m using the Ruby Version Manager (RVM).

What I’d like to do is add a button to my top panel in Ubuntu that would run the script for me in a terminal window. When I try to put this in a panel launcher, though, I get an error stating “There was an error creating the child process for this terminal”.

Also, since the script has a lot of output that I’d like to be able to inspect, I’d like the terminal window to start maximized. The script is already set up to require user input before it exits, so the terminal closing prematurely isn’t a problem.

Any suggestions on how I should set this up? I’m running Lucid Lynx. Thank you!
or Cancel

3 answers

0

patcito [ Editor ]

Right click on the desktop, click on “create launcher”, pick a name and in command put your script there, drag and drop it to your panel. If you want it to start the terminal, you could do something like that:


gnome-terminal -e /path/to/script

Or:

xterm -hold -e /path/to/script


or Cancel
0

nitrofurano

you say panel, the Gnome panel? i’m asking you this because a lot of other window managers also has panels, like lxde, fluxbox, jwm, etc…

ins’t running ruby scripts from panel custom icon (.desktop file, i think) as easy as running python scripts?
NN comments
precious bodily fluids
-

Yes, I think I’m running Gnome.

I don’t know, I’ve never run a Python script… I’m just wondering what command the launcher should have to make this work.

or Cancel

Your answer

You need to join Ubuntu to complete this action, click here to do so.