You are not logged in.

#1 2020-04-14 15:04:43

reiniermaliepaard
Member
Registered: 2018-12-31
Posts: 6

[SOLVED] x-terminal-emulator and two commands

Hello,

Bunsenlabs Helium in menu.xml, I've the following code

<item label="Sabnzbdplus1">
<action name="Execute">
<command>
   x-terminal-emulator -T 'sabnzbdplus' -e sabnzbdplus
</command>
</action>
</item> 
<item label="Sabnzbdplus2">
<action name="Execute">
<command>
   x-terminal-emulator -T 'sabnzbdplus2' -e firefox-esr http://127.0.0.1:8080/sabnzbd
</command>
</action>
</item>

I invoke Sabnzbdplus1 and then Sabnzbdplus2. What I want is to invoke these separate commands in one single command. I tried several things like && as follows

x-terminal-emulator -T 'sabnzbdplus' -e sabnzbdplus && firefox-esr http://127.0.0.1:8080/sabnzbd

But was not succesful. Any idea? Thanks in advance.

Best regards,
Reinier

Last edited by hhh (2020-04-14 18:38:32)

Offline

#2 2020-04-14 15:24:12

damo
....moderator....
Registered: 2015-08-20
Posts: 5,982

Re: [SOLVED] x-terminal-emulator and two commands

I usually find it easier to put multiple commands in a script eg

#!/bin/bash
# sabnzbdplus.sh

sabnzbdplus && firefox-esr http://127.0.0.1:8080/sabnzbd

If your command needs to run in a terminal then adjust the script accordingly.

<item label="Sabnzbdplus">
<action name="Execute">
<command>
  sabnzbdplus.sh
</command>
</action>
</item>

Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Online

#3 2020-04-14 16:23:39

reiniermaliepaard
Member
Registered: 2018-12-31
Posts: 6

Re: [SOLVED] x-terminal-emulator and two commands

Hi Damo,

Thanks for your reply. Unfortunately, your solution seems not to work: sabnzbdplus starts correctly but only when I close sabnzbdplus, Firefox starts (this behaviour I do remember when I was searching for solutions).

Normally, starting sabnzbdplus would invoke Firefox automatically. That worked for me in Bunsenlabs Helium. However, after some updates, there arised a problem, which I think causes Firefox not to start:

/usr/bin/xdg-open: 630: /usr/bin/xdg-open: exo-open: not found

I was not able to install the missing software.

Bunsenlabs Lithium does not have the problem. Any idea? Thanks.

Best regards,
Reinier

Offline

#4 2020-04-14 16:27:15

DeepDayze
Member
From: In Linux Land
Registered: 2017-05-28
Posts: 860

Re: [SOLVED] x-terminal-emulator and two commands

reiniermaliepaard wrote:

Hi Damo,

Thanks for your reply. Unfortunately, your solution seems not to work: sabnzbdplus starts correctly but only when I close sabnzbdplus, Firefox starts (this behaviour I do remember when I was searching for solutions).

Normally, starting sabnzbdplus would invoke Firefox automatically. That worked for me in Bunsenlabs Helium. However, after some updates, there arised a problem, which I think causes Firefox not to start:

/usr/bin/xdg-open: 630: /usr/bin/xdg-open: exo-open: not found

I was not able to install the missing software.

Bunsenlabs Lithium does not have the problem. Any idea? Thanks.

Best regards,
Reinier

Do you have exo-utils installed? That package provides the exo-open command.

Last edited by DeepDayze (2020-04-14 16:27:59)


Real Men Use Linux

Online

#5 2020-04-14 16:41:39

reiniermaliepaard
Member
Registered: 2018-12-31
Posts: 6

Re: [SOLVED] x-terminal-emulator and two commands

Thank you. That did the job!

Reinier

Offline

#6 2020-04-14 17:32:52

DeepDayze
Member
From: In Linux Land
Registered: 2017-05-28
Posts: 860

Re: [SOLVED] x-terminal-emulator and two commands

reiniermaliepaard wrote:

Thank you. That did the job!

Reinier

So your 2 scripts work now?


Real Men Use Linux

Online

#7 2020-04-14 18:35:11

reiniermaliepaard
Member
Registered: 2018-12-31
Posts: 6

Re: [SOLVED] x-terminal-emulator and two commands

Hi,

Only this script in menu.xml is necessary:

<item label="Sabnzbdplus">
  <action name="Execute">
    <command>
     x-terminal-emulator -T 'sabnzbdplus' -e sabnzbdplus
    </command>
  </action>
</item>

and firefox-esr http://127.0.0.1:8080/sabnzbd starts automatically.

It is the same script I used last year before the problem a few months ago arised.

Thanks again!

Best regards,
Reinier

Offline

#8 2020-04-14 18:38:02

hhh
Meep!
Registered: 2015-09-17
Posts: 9,632
Website

Re: [SOLVED] x-terminal-emulator and two commands

Making this [SOLVED].

-hhh moderator-

Offline

#9 2020-04-15 06:09:39

ohnonot
...again
Registered: 2015-09-29
Posts: 4,525
Website

Re: [SOLVED] x-terminal-emulator and two commands

Great that you solved it!

reiniermaliepaard wrote:

x-terminal-emulator -T 'sabnzbdplus' -e sabnzbdplus && firefox-esr http://127.0.0.1:8080/sabnzbd
But was not succesful.

Generally, something like this is possible with openbox' rc.xml, but will not work exactly like this for 3 reasons:

  • openbox does not automatically execute a shell when executing commands, so the whole command would need to be passed to a shell first for things like && and & to work

  • the && waits for the first command to return a value before it runs the second command. A single & will put the first command in the background instead, then immediately launch the second.

  • openbox' XML parser won’t be able to deal with the & as such, it needs to be written like this: &amp;

All in all, writing a miniscript and pointing openbox to that might the easiest solution, but this would also work:

<command>
dash -c 'x-terminal-emulator -T 'sabnzbdplus' -e sabnzbdplus &amp; firefox-esr http://127.0.0.1:8080/sabnzbd'
</command>

BL quote proposals to this thread please.
how to ask smart questions | my repos / my repos | my blog
---
Thank you for posting direct image links!

Offline

#10 2020-04-15 15:53:09

reiniermaliepaard
Member
Registered: 2018-12-31
Posts: 6

Re: [SOLVED] x-terminal-emulator and two commands

Hello,

Thanks for the additional information. It does not work as it should:

I remove exo-utils from my system and run your command:

dash -c 'x-terminal-emulator -T 'sabnzbdplus' -e sabnzbdplus &amp; firefox-esr http://127.0.0.1:8080/sabnzbd]http://127.0.0.1:8080/sabnzbd'

-> Firefox starts with http://127.0.0.1:8080/sabnzbd with error message 'Problem loading page'
-> Sabnzb starts

Then:

dash -c 'x-terminal-emulator -T 'sabnzbdplus' -e sabnzbdplus &amp;&amp; firefox-esr http://127.0.0.1:8080/sabnzbd]http://127.0.0.1:8080/sabnzbd'

-> Sabnzb starts

and Firefox does not start with http://127.0.0.1:8080/sabnzbd

so I reinstall exo-utils and run

x-terminal-emulator -T 'sabnzbdplus' -e sabnzbdplus

succesfully.

Best regards,
Reinier

Last edited by hhh (2020-04-16 16:58:40)

Offline

#11 2020-04-16 05:32:09

ohnonot
...again
Registered: 2015-09-29
Posts: 4,525
Website

Re: [SOLVED] x-terminal-emulator and two commands

reiniermaliepaard wrote:

I remove exo-utils from my system and run your command:

<command>
dash -c 'x-terminal-emulator -T 'sabnzbdplus' -e sabnzbdplus &amp; firefox-esr http://127.0.0.1:8080/sabnzbd]http://127.0.0.1:8080/sabnzbd'
</command>

-> Firefox starts with http://127.0.0.1:8080/sabnzbd with error message 'Problem loading page'
-> Sabnzb starts

You probably just need a delay between starting the application and the browser.
You could try waiting for however long sabnx needs to fire up, then reload the page in your browser (F5 or Ctrl-F5).
Or you add a delay in your command:

<command>
dash -c 'x-terminal-emulator -T 'sabnzbdplus' -e sabnzbdplus &amp; sleep 5; firefox-esr http://127.0.0.1:8080/sabnzbd]http://127.0.0.1:8080/sabnzbd'
</command>

PS: please use code tags for code. Thanks.


BL quote proposals to this thread please.
how to ask smart questions | my repos / my repos | my blog
---
Thank you for posting direct image links!

Offline

#12 2020-04-16 16:59:27

hhh
Meep!
Registered: 2015-09-17
Posts: 9,632
Website

Re: [SOLVED] x-terminal-emulator and two commands

ohnonot wrote:

PS: please use code tags for code. Thanks.

Fixed by me, I think.

Offline

Board footer

Powered by FluxBB