You are not logged in.

#1 2016-06-01 01:51:35

KrunchTime
Member
Registered: 2015-09-29
Posts: 857

[SOLVED] How to Call a Bash Script Via the Openbox Menu

I've downloaded the Liri browser, portable edition and can't figure out how to make an Openbox menu entry to run the bash script that starts the browser.  Entries I've tried:

~/bin/liri-browser-linux-portable/run-liri
~/bin/liri-browser-linux-portable/run-liri.sh
~/bin/liri-browser-linux-portable/./run-liri
~/bin/liri-browser-linux-portable/./run-liri.sh
sh ~/bin/liri-browser-linux-portable/run-liri
sh ~/bin/liri-browser-linux-portable/run-liri.sh
sh ~/bin/liri-browser-linux-portable/./run-liri.sh
sh ./~/bin/liri-browser-linux-portable/run-liri
sh ./~/bin/liri-browser-linux-portable/run-liri.sh

Running

sh run-liri.sh

or

sh ./run-liri.sh

from terminal under ~/bin/liri-browser-linux-portable works.

Last edited by KrunchTime (2016-06-01 04:36:50)

Offline

#2 2016-06-01 02:03:32

Horizon_Brave
Operating System: Linux-Nettrix
Registered: 2015-10-18
Posts: 1,473

Re: [SOLVED] How to Call a Bash Script Via the Openbox Menu

Try it without the ~ abbreviation.  Speficy out the full path to the script, using your /home/<name/  prefix instead of the ~


"I have not failed, I have found 10,000 ways that will not work" -Edison

Offline

#3 2016-06-01 02:12:22

Eraph
Member
From: /au/qld/bne
Registered: 2016-02-29
Posts: 282
Website

Re: [SOLVED] How to Call a Bash Script Via the Openbox Menu

Can you show us what the OpenBox menu entry looks like as well, in case the problem is in there?


Lenovo IdeaPad Yoga 13 | BunsenLabs Hydrogen (x64)
Intel Core i7-3537U | Intel HD4000 | 8GB DDR3 | 256GB SSD

Offline

#4 2016-06-01 02:17:06

KrunchTime
Member
Registered: 2015-09-29
Posts: 857

Re: [SOLVED] How to Call a Bash Script Via the Openbox Menu

@Horizon_Brave:  No go.

@Eraph:  re: Entries I've tried:

Offline

#5 2016-06-01 02:24:32

Horizon_Brave
Operating System: Linux-Nettrix
Registered: 2015-10-18
Posts: 1,473

Re: [SOLVED] How to Call a Bash Script Via the Openbox Menu

Can you run the command successfully by doing 

sh /~/bin/liri-browser-linux-portable/run-liri.sh

   

but not cding to the the sh ./~/bin/liri-browser-linux-portable/   directory?

Are you getting any errors?  Try the above and then do

echo $?

To see if that gives you any further insight


"I have not failed, I have found 10,000 ways that will not work" -Edison

Offline

#6 2016-06-01 02:29:47

KrunchTime
Member
Registered: 2015-09-29
Posts: 857

Re: [SOLVED] How to Call a Bash Script Via the Openbox Menu

@Horizon_Brave:  I don't understand what you mean by but not cding to the sh ./~/bin/liri-browser-linux-portable/ directory.

I tried the first command listed in your response on the command line and received a sh: 0: Can't open /~/bin/liri-browser-linux-portable/run-liri.sh error.  Running the following on the command line:

sh /home/<user>/bin/liri-browser-linux-portable/run-liri.sh

I get ./liri-browser: not found error.  The last line of the script:

./liri-browser

liri-browser is an executable within the same folder.

Last edited by KrunchTime (2016-06-01 02:37:03)

Offline

#7 2016-06-01 03:18:56

Eraph
Member
From: /au/qld/bne
Registered: 2016-02-29
Posts: 282
Website

Re: [SOLVED] How to Call a Bash Script Via the Openbox Menu

KrunchTime wrote:

@Eraph:  re: Entries I've tried:

I meant the actual XML Menu entry. I doubt it's the problem, I'm only asking as a "just in case".

<item label="LABEL">...

Lenovo IdeaPad Yoga 13 | BunsenLabs Hydrogen (x64)
Intel Core i7-3537U | Intel HD4000 | 8GB DDR3 | 256GB SSD

Offline

#8 2016-06-01 03:23:21

Horizon_Brave
Operating System: Linux-Nettrix
Registered: 2015-10-18
Posts: 1,473

Re: [SOLVED] How to Call a Bash Script Via the Openbox Menu

Krunch, try changing the last line of the script from  ./liri-browser   to the full path name of the liri-browser.  So change it to:

sh /home/<user>/bin/liri-browser-linux-portable/run-liri.sh

Last edited by Horizon_Brave (2016-06-01 03:23:49)


"I have not failed, I have found 10,000 ways that will not work" -Edison

Offline

#9 2016-06-01 03:57:28

KrunchTime
Member
Registered: 2015-09-29
Posts: 857

Re: [SOLVED] How to Call a Bash Script Via the Openbox Menu

@Horizon_Brave:  Doesn't work.

Offline

#10 2016-06-01 04:36:25

KrunchTime
Member
Registered: 2015-09-29
Posts: 857

Re: [SOLVED] How to Call a Bash Script Via the Openbox Menu

OK...I figured it out with the help of a post over at the AskUbuntu site (see the response by naisanza).  I added the following line near the beginning of the run-liri.sh script:

cd $(dirname $0)

According to the post at the referenced site, that line of code sets the folder containing the script to be the root folder.

The command to run the script from the openbox menu:

~/bin/liri-browser-linux-portable/./run-liri.sh

Woo hoo, another browser to use!

Last edited by KrunchTime (2016-06-01 05:13:22)

Offline

#11 2016-06-01 05:35:00

Horizon_Brave
Operating System: Linux-Nettrix
Registered: 2015-10-18
Posts: 1,473

Re: [SOLVED] How to Call a Bash Script Via the Openbox Menu

Darn! I was going to suggest something similar, but I was going to say, but the cd command in the openbox menu script.... Congrats though.


"I have not failed, I have found 10,000 ways that will not work" -Edison

Offline

Board footer

Powered by FluxBB