You are not logged in.

#1 2024-10-02 15:11:06

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,008

OB - menu.xml - dual entries possible?

I'm wondering if I can open 2 GUI applications from one openbox menu entry.

Normally they look like this:

<item label="New Item">
        <action name="Execute">
                <execute>command 1</execute>
        </action>
</item>

I'd like to add an extra <action> like this:

<item label="New Item">
        <action name="Execute">
                <execute>command 1</execute>
        </action>
        <action name="Execute">
                <execute>command 2</execute>
        </action>
</item>

More specifically this:

			<item label="FoxPad">
				<action name="Execute">
					<execute>mousepad /path/to/text1.txt /path/to/text2.txt</execute>
				</action>
				<action name="Execute">
					<execute>firefox https://url.to.site</execute>
				</action>
			</item>

POSSIBLE?


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#2 2024-10-03 02:05:42

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 12,550
Website

Re: OB - menu.xml - dual entries possible?

Try it!

I've seen things like that so it ought to be possible.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )

Introduction to the Bunsenlabs Boron Desktop

Online

#3 2024-10-03 02:33:18

PackRat
jgmenu user Numero Uno
Registered: 2015-10-02
Posts: 2,611

Re: OB - menu.xml - dual entries possible?

This might work:

		<item label="FoxPad">
				<action name="Execute">
					<execute>mousepad /path/to/text1.txt /path/to/text2.txt</execute>
					<execute>firefox https://url.to.site</execute>
				</action>
			</item>

The "</action>" terminates the action spawned by the keybind so you only want one.

The other option might be be to string the actions together (or write a script)

 <execute>mousepad file1 file2 && firefox</execute> 

You must unlearn what you have learned.
    -- yoda

Offline

#4 2024-10-03 04:43:14

Sector11
Mod Squid Tpyo Knig
From: Upstairs
Registered: 2015-08-20
Posts: 8,008

Re: OB - menu.xml - dual entries possible?

@PackRat
I saw that 2 action thing in a page talking about "keubinds" in the rc.zml that's why I was wondering it it would work in "menu.xml" as I didn't want start a shell.

 <execute>mousepad file1 file2 && firefox</execute> 

Could not find an example of that working but will try
Thank you


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#5 2024-10-03 12:31:43

PackRat
jgmenu user Numero Uno
Registered: 2015-10-02
Posts: 2,611

Re: OB - menu.xml - dual entries possible?

You can probably accomplish this with a openbox pipe menu.

Do a search for pipe menu scripts and you may find one you can adapt.

quick hack -

#!/bin/sh
# example script (hack) to lunch two
# actions from openbox menu

EDITOR=`sublime_text ~/.xinitrc`
BROWSER=`firefox www.mlb.com`

while :; do
	$EDITOR
	$BROWSER
done

adjust EDITOR and BOWSER to your specific use case and launch the script from menu or key bind. It works from the terminal. Don't have openbox installed on this particular laptop so can't test window manager specifics.


You must unlearn what you have learned.
    -- yoda

Offline

Board footer

Powered by FluxBB