Topic: Trouble Adding a shell script to Openbox Menu

I'm having some trouble getting a shell script to execute from the Openbox menu.  The script runs fine from Thunar.  Here is the section in question from my menu.xml:

<item label="MOOS Project Viewer">
  <action name="Execute">
    <execute>
      /home/tj/.MOOS/MOOS.sh
    </execute>
  </action>
</item>

Re: Trouble Adding a shell script to Openbox Menu

have you tried adding sh in front of the file i.e "sh /home/myuser/myscript.sh"?

That usually works for me.

Re: Trouble Adding a shell script to Openbox Menu

Also...if you want it to open it in terminator (so you can see the script working) you might want to try telling openbox to open it in a new terminal instance a la "terminator --command="/Path/to/script.sh"

IRC: PizzaAndWine     Script bits: Incremental Backup | Sleep Timer

Re: Trouble Adding a shell script to Openbox Menu

Adding "sh" didn't work but I did try launching from my home directory in terminator and got the following error. 

tj@crunchbang:~$ /home/tj/.MOOS/MOOS.sh
Exception in thread "main" java.lang.NoClassDefFoundError: com/sbs/jpm/Main
Caused by: java.lang.ClassNotFoundException: com.sbs.jpm.Main
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:334)
Could not find the main class: com.sbs.jpm.Main. Program will exit.

Obviously I'm missing something because it launches fine when I browse to the script from Thunar.  It also launches fine from Terminator when I drill down to the directory that the script actually lives in.

Re: Trouble Adding a shell script to Openbox Menu

I'm no java expert but could it be looking for a lib in the current directory (where ever openbox decides that is), try cding to the directory where you normally launch your java app from, in your .sh wrapper script.

- - - - - - - - Wiki Pages - - - - - - -
#! install guide           *autostart programs, modify the menu & keybindings
configuring Conky       *installing scripts

Re: Trouble Adding a shell script to Openbox Menu

Adding a simple "cd /home/tj/.MOOS/" to the script fixed everything.

Thanks for the help.