Xfce Forum

Sub domains
 

You are not logged in.

#1 2011-06-08 03:41:31

xcrx
Member
Registered: 2011-06-08
Posts: 3

[Solved] I can't get my launcher to run a script

I am trying to make a launcher on my desktop to run a bash script but I can't seem to get it to work. In the "command" line I put the path to the script and I have tried running it in the terminal and not in the teminal but it fails to run.

I am sure this is an easy fix but I can't seem to find it. If anyone would point me in the right direction it would be greatly appreciated.

xfce 4.8.0
Arch Linux

Offline

#2 2011-06-08 09:12:40

Ailurus
Member
Registered: 2011-05-19
Posts: 42

Re: [Solved] I can't get my launcher to run a script

Hmm, without the actual commands, scripts and errors it might be a little difficult to solve your problem. Only general thing I think of, is your script executable? You can set this in the terminal by typing chmod +x yourfile.sh, or in a graphical way - Right click file -> Properties -> Tab "Permissions" -> Check box "Allow this file to run as a program".

Last edited by Ailurus (2011-06-08 09:13:20)

Offline

#3 2011-06-08 12:30:14

xcrx
Member
Registered: 2011-06-08
Posts: 3

Re: [Solved] I can't get my launcher to run a script

my script is executible. I can run it from the terminal if i cd to the directory and run ./script.sh fine and I can also double click on the script in thunar and it runs properly. The error I get says Failed to run "CRONoMeter.desktop" - Failed to execute child process "/home/xcrx/cronometer/cronometer.sh". I have also tried /home/xcrx/cronometer/./cronometer.sh which brings up the terminal and closes it immediatly.  I searched around for a hour last night but I couldn't seem to find anything.

I have pasted the script code below I am not sure if you need it.

#!/bin/sh
cd "CRONoMeter.app/Contents/Resources/Java/"
java -cp cronometer.jar:jcommon-1.0.10.jar:jfreechart-1.0.6.jar:swingx-0.9.3.jar:cronometer.jar:usda_sr23.jar:crdb_005.jar:docs.jar ca.spaz.cron.CRONOMETER

Offline

#4 2011-06-08 23:37:45

phrac
Member
Registered: 2011-03-24
Posts: 19

Re: [Solved] I can't get my launcher to run a script

xcrx wrote:

I can run it from the terminal if i cd to the directory and run ./script.sh fine and I can also double click on the script in thunar and it runs properly.

That's good as it sounds like it is just the launcher command with the problem. What OS are you using? In Arch it is called "terminal" in Ubuntu it is "xfce4-terminal". From personal experience I've found the flags -H -x are best for keeping the terminal open and executing a command which would follow with a space and without quotes after -x.

Try using the full path to the script within the launcher command. An example for Ubuntu if the directory is within your home folder:

xfce4-terminal -H -x /home/<username>/CRONoMeter.app/Contents/Resources/Java/script.sh

Good luck with it and let me know if you get any problems and I'll try to help.

Last edited by phrac (2011-06-08 23:45:59)

Offline

#5 2011-06-10 12:34:47

xcrx
Member
Registered: 2011-06-08
Posts: 3

Re: [Solved] I can't get my launcher to run a script

That did it!

Thank you for the help. I will keep those flags in mind. I am sure I will need them again.

Offline

#6 2011-06-10 16:22:40

phrac
Member
Registered: 2011-03-24
Posts: 19

Re: [Solved] I can't get my launcher to run a script

Hey, your welcome! Works well with custom menus and stuff too.

Offline

Board footer

Powered by FluxBB