You are not logged in.
Pages: 1
[Solved] -> using a bash script.
It is possible to have and OpenBox "action" open two applications?
Example idea #1:
<item label="One - Two">
<action name="Execute">
<execute>one</execute>
<execute>two</execute>
</action>
</item>OR maybe example idea #1:
<item label="One - Two">
<action name="Execute">
<execute>one</execute>
</action>
<action name="Execute">
<execute>two</execute>
</action>
</item>Asking before, read: in case, I really mess up my menu.
Cannot seen to find anything on the net so I'm leaning to
NOT POSSIBLE!
I'm interested in opening a spreadsheet and a PDF file with one click.
Last edited by Sector11 (Today 02:36:05)
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
Are you looking to open a blank spreadsheet and a separate pdf file, or do you want to open the pdf file with the spreadsheet application?
Libreoffice for the spreadsheet ?
Which app for the pdf?
You must unlearn what you have learned.
-- yoda
Online
Try this. I use xreader for pdf, adjust for your system.
<keybind key="W-space">
<action name="Execute">
<startupnotify>
<enabled>yes</enabled>
<name>Some_Name</name>
<icon>Some_Icon</icon>
</startupnotify>
<command>xreader some.pdf & libreoffice --calc</command>
</action>Another option would be to write a bash script to open the pdf and spreadsheet and launch the script from the menu.
You must unlearn what you have learned.
-- yoda
Online
Try this. I use xreader for pdf, adjust for your system.
<keybind key="W-space"> <action name="Execute"> <startupnotify> <enabled>yes</enabled> <name>Some_Name</name> <icon>Some_Icon</icon> </startupnotify> <command>xreader some.pdf & libreoffice --calc</command> </action>Another option would be to write a bash script to open the pdf and spreadsheet and launch the script from the menu.
OH! Never thought of the rc.xml file.
localc /path/to/calc.ods & atril /path/to/the.pdfNope my rc.xml did not like the " & "
And I'm locked out of OB. ![]()
No right click no shortcut keys.
Time to reboot and X fingers
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
Time to reboot and X fingers
OK [Ctrl]+[z] brought the rc.xml file bact to it's original state and shutting down everything and powering off / on brought OB back to life.
@PackRat - Yours:
<keybind key="W-space">
<action name="Execute">
<startupnotify>
<enabled>yes</enabled>
<name>Some_Name</name>
<icon>Some_Icon</icon>
</startupnotify>
<command>xreader some.pdf & libreoffice --calc</command>
</action>My keyboard section looks like this:
<keybind key="A-1">
<action name="Execute">
<startupnotify>
<enabled>false</enabled>
<name>AYSA</name>
</startupnotify>
<command>localc /media/5/Documents/Aysa/aysa.2026.ods & thunar /media/5/Documents/Aysa/2026.PDF/</command>
</action>
</keybind>Opens a window: Openbox Syntax Error
One or more XML syntax errors were found
while parsing the Openbox configuration
files. See stdout for more information.
The last error was in file "home/
sector11/,config/openbox/rc.xml" line 443,
with message: xmlParseEntityRef: no nameThe " & " has a red background!
localc - opens a yearlly spreadsheet
thinar opens the foolder where the monthly AYSA bills are kept
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
My bad. Gave you a key binding not a menu entry.
<item label="Some name">
<action name="Execute">
<command>xreader pdf-file.pdf & libreoffice --calc</command>
</action>
</item>If the openbox xml syntax doesn't like the "&", then create a bash script and launch the script from the menu.
Over simplified, but should work. Save to somewhere on your $PATH and make it executable.
#!/bin/sh
localc /path/to/calc.ods &
sleep 2s ; atril /path/to/the.pdf &what's "localc"? Bash alias?
Those don't always work, use the actual command.
You must unlearn what you have learned.
-- yoda
Online
My bad. Gave you a key binding not a menu entry.
<item label="Some name"> <action name="Execute"> <command>xreader pdf-file.pdf & libreoffice --calc</command> </action> </item>If the openbox xml syntax doesn't like the "&", then create a bash script and launch the script from the menu.
Over simplified, but should work. Save to somewhere on your $PATH and make it executable.
#!/bin/sh sleep 2s ; atril /path/to/the.pdf &what's "localc"? Bash alias?
Those don't always work, use the actual command.
Yes, I realized it was a keybind, I use them a lot.
I was talking about the " & " not working in the rc.xml keyboard section - better for me than in menu.xml
HOWEVER my OpenBox decided elsewise.
/home/sector11/.config/openbox/rc.xml
<!-- Keybindings for running applications -->
<!-- <keybind key="A-1">
<action name="Execute">
<startupnotify>
<enabled>false</enabled>
<name>Aysa</name>
</startupnotify>
<command>localc /media/5/Documents/Aysa/aysa.2026.ods thunar /media/5/Documents/Aysa/2026.PDF/</command>
</action>
</keybind> -->
<keybind key="A-d">
<action name="Execute">
<startupnotify>
<enabled>true</enabled>
<name>Discord</name>
</startupnotify>
<command>firefox https://discord.com/channels/@me /media/5/Documents/Discord-markdown-text-101.txt</command>
</action>
</keybind>localc is NOT a bash alias ... but a short form of "libreoffice --calc" its in the man page:
Name
libreoffice − LibreOffice office suite
SYNOPSIS
libreoffice [−−accept=accept−string] [−−base] [−−calc] [−−convert−to output_file_extension[:output_fil-
ter_name] [−−outdir output_dir] file]... [−−display display] [−−draw] [−−global] [−−headless]
[−−help|−h|−?] [−−impress] [−−invisible] [−−infilter="<filter>"] [−−math] [−−minimized] [−n file]...
[−−nodefault] [−−nolockcheck] [−−nologo] [−−norestore] [−o file]... [−p file...] [−−print−to−file
[−−printer−name printer_name] [−−outdir output_dir] file]... [−−pt printername file...] [−−show Im-
press file]... [−−unaccept=accept−string] [−−terminate_after_init] [−−view file]... [−−web] [−−writer]
[file...]
lobase
localc
lodraw
lofromtemplate
loimpress
lomath
loweb
lowriter
DESCRIPTION
LibreOffice (LO for short) is a multi-platform office productivity suite. It was derived from OpenOffice.org
3.3 Beta on September 28, 2010.They all just work:
lobase
localc
lodraw
lofromtemplate
loimpress
lomath
loweb
lowriter
Bash script it is.
Thanks
Debian 12 Beardog, SoxDog and still a Conky 1.9er
Offline
It comes down to openbox menu entry commands not allowing shell stuff like "&" or much else. What is allowed is a one-word command and some optional arguments. That's all. So yes a bash script is probably the best way to go. This applies to a lot of other situations like yad buttons, not only openbox menus.
Another trickier option which also works if the shell stuff you want to run isn't too complicated is to make "bash" the command and "-c" "shell stuff" the two arguments. Try this in a terminal:
bash -c 'echo "press Enter to continue"; read; echo "Bye..."; sleep 2'Everything inside the single quotes is considered to be a single argument and passed on to bash.
But it's usually easier to make a separate script.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky and Mastodon, there's also some GitStuff )
Offline
Pages: 1