You are not logged in.

#1 2024-11-04 12:08:41

MarkW
Member
Registered: 2024-11-03
Posts: 240

I Want To Add Applications To The Openbox rc.xml File

Someone please show me how so I don't hose my system again.  Nested <>s confuse me.

Offline

#2 2024-11-04 14:41:37

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

Re: I Want To Add Applications To The Openbox rc.xml File

This Help:Contents page is you friend, until your look at it.  Then it's "YEA! RIGHT!"

OK now let me ask a question: What do you mean by: add a file?

I ask because I add files to my

menu.xml

and key-binds to my

rc.xml

Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#3 2024-11-04 16:05:25

MarkW
Member
Registered: 2024-11-03
Posts: 240

Re: I Want To Add Applications To The Openbox rc.xml File

Application.  Like Firefox.  I refer you to line 707 and onwards of the xml.rc file.

Offline

#4 2024-11-05 04:12:52

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

Re: I Want To Add Applications To The Openbox rc.xml File

My rc.xml file is highly modified so line reference doesn't apply.

open your rc.xml file san search for:

W-w

You'll find 'firefox-esr' as a sample

    <keybind key="W-w">
      <action name="Execute">
        <startupnotify>
          <enabled>false</enabled>
          <name>Web Browser</name>
        </startupnotify>
        <command>firefox-esr</command>
      </action>
    </keybind>

A simple way for the program 'peek' for example.
First check to make sure 'Alt-p' isn't used and add it:

    <keybind key="A-p">
      <action name="Execute">
        <command>peek</command>
      </action>
    </keybind>

For every action there is an equal and opposite reaction:
    <keybind key="···"> needs a </keybind>
      <action name="Execute"> needs a </action>
        <command>·······</command>


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#5 2024-11-05 10:41:36

MarkW
Member
Registered: 2024-11-03
Posts: 240

Re: I Want To Add Applications To The Openbox rc.xml File

It's not how to do them, it's where to put them.  I don't know how to explain it if you haven't read the applications section (at the end) of the xml.rc file.  The one that starts

<applications>     <!--   # this is an example with comments through out. use these to make your   # own rules, but without the comments of course.   # you may use one or more of the name/class/role/title/type rules to specify   # windows to match

And ends

# end of the example -->   </applications> </openbox_config>

I am utterly paranoid about getting it wrong again after following what was obviously bad advice (will post as soon as I can find it again)

Offline

#6 2024-11-05 11:50:22

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

Re: I Want To Add Applications To The Openbox rc.xml File

OH.  I'm not the guy then.
I do it by guess or bu golly.
Mucked it up a few times.


Debian 12 Beardog, SoxDog and still a Conky 1.9er

Offline

#7 2024-11-05 11:53:39

MarkW
Member
Registered: 2024-11-03
Posts: 240

Re: I Want To Add Applications To The Openbox rc.xml File

Would this work?

<application>"Discord"</application>
  <decor>yes</decor>
  <shade>no</shade>
  <position force=>"no"</position>
  <desktop>3</desktop>

Offline

#8 2024-11-05 16:41:02

Colonel Panic
Member
Registered: 2018-11-13
Posts: 1,403

Re: I Want To Add Applications To The Openbox rc.xml File

Apologies if this isn't helpful but I put the absolute minimum of applications in either my menu.xml or my rc.xml files. For everything else I rely on DMenu or JGMenu, both of which I've installed.

Here's my latest menu.

<?xml version="1.0" encoding="utf-8"?>
<openbox_menu xmlns="http://openbox.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://openbox.org/                 file:///usr/share/openbox/menu.xsd">
	<menu id="root-menu" label="Openbox 3">
		<item label="Terminal emulator">
			<action name="Execute">
				<execute>roxterm</execute>
			</action>
		</item>
		<item label="Web browser">
			<action name="Execute">
				<execute>firefox</execute>
			</action>
		</item>
		<!-- This requires the presence of the 'menu' package to work -->
		<item label="Gkrellm">
			<action name="Execute">
				<execute>gkrellm</execute>
			</action>
		</item>
		<item label="Plank">
			<action name="Execute">
				<execute>plank</execute>
			</action>
		</item>
		<item label="SpaceFM">
			<action name="Execute">
				<execute>spacefm</execute>
			</action>
		</item>
		<item label="Tint2">
			<action name="Execute">
				<execute>tint2</execute>
			</action>
		</item>
		<item label="DMenu">
			<action name="Execute">
				<execute>dmenu_run</execute>
			</action>
		</item>
		<item label="JGMenu">
			<action name="Execute">
				<execute>jgmenu_run</execute>
			</action>			
		</item>
		<menu id="Debian"/>
		<separator/>
		<menu id="client-list-menu"/>
		<separator/>
		<item label="ObConf">
			<action name="Execute">
				<execute>obconf</execute>
			</action>
		</item>
		<item label="Xkill">
			<action name="Execute">
				<execute>xkill</execute>
			</action>
		</item>
		<item label="Reconfigure">
			<action name="Reconfigure"/>
		</item>
		<item label="Restart">
			<action name="Restart"/>
		</item>
		<separator/>
  <menu id='/Debian/Window Managers' label='Window Managers'>
    <item label='Ctwm'>
      <action name='Restart'><execute>ctwm</execute></action>
    </item>
    <item label='FluxBox'>
      <action name='Restart'><execute>/usr/bin/startfluxbox</execute></action>
    </item>
    <item label='FVWM'>
      <action name='Restart'><execute>/usr/bin/fvwm2</execute></action>
    </item>
    <item label='Olvwm'>
      <action name='Restart'><execute>/usr/bin/olvwm</execute></action>
    </item>
    <item label='Openbox' icon='/usr/share/pixmaps/openbox.xpm'>
      <action name='Restart'><execute>/usr/bin/openbox</execute></action>
    </item>
    <item label='VTWM'>
      <action name='Restart'><execute>vtwm</execute></action>
    </item>
  </menu>
	<item label="Log Out">
			<action name="Exit"/>
			<prompt>yes</prompt>
			</action>
		</item>
	</menu>
</openbox_menu>

Offline

#9 2024-11-05 16:46:56

MarkW
Member
Registered: 2024-11-03
Posts: 240

Re: I Want To Add Applications To The Openbox rc.xml File

Yes, that's not what I'm trying to do.  Look at the fifth line of my example

Offline

#10 2024-11-05 19:09:06

novice
Member
Registered: 2020-01-30
Posts: 61

Re: I Want To Add Applications To The Openbox rc.xml File

You need to be a bit clearer about what you are wanting to do. I do the same thing when I ask these guys questions. They know their stuff but they need to know exactly what you are trying to do.

MarkW wrote:

Would this work?

<application>"Discord"</application>
  <decor>yes</decor>
  <shade>no</shade>
  <position force=>"no"</position>
  <desktop>3</desktop>

That's almost right, but I think the first line should be:
<application name="Discord">

You need to make sure that 'Discord' is the correct _OB_APP_NAME. Check this by opening Discord and then typing this into a terminal:

obxprop | grep "^_OB_APP"

Then click on the Discord window and you should get some info:

_OB_APP_TYPE(UTF8_STRING) = "normal"
_OB_APP_TITLE(UTF8_STRING) = "Mozilla Firefox"
_OB_APP_GROUP_CLASS(UTF8_STRING) = "Firefox-esr"
_OB_APP_GROUP_NAME(UTF8_STRING) = "firefox-esr"
_OB_APP_CLASS(UTF8_STRING) = "firefox-esr"
_OB_APP_NAME(UTF8_STRING) = "Navigator"
_OB_APP_ROLE(UTF8_STRING) = "browser"


That will give you the correct name. Just put your code between the <applications> and </applications> tags in the rc.xml file.


Hope this helps.

Offline

#11 2024-11-05 19:27:59

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

Re: I Want To Add Applications To The Openbox rc.xml File

MarkW wrote:

Would this work?

<application>"Discord"</application>
  <decor>yes</decor>
  <shade>no</shade>
  <position force=>"no"</position>
  <desktop>3</desktop>

No, because you need to specify if Discord is the name, class, etc ... of the window. And it looks like some other syntax errors.

Here's an example for deadbeef music player:

    <application class="Deadbeef*">
      <desktop>4</desktop>
      <maximized>no</maximized>
      <skip_pager>no</skip_pager>
      <skip_taskbar>no</skip_taskbar>
    </application>

Here's the official openbox documentation for per app settings - https://openbox.org/help/Applications


You must unlearn what you have learned.
    -- yoda

Offline

#12 2024-11-05 19:32:47

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

Re: I Want To Add Applications To The Openbox rc.xml File

MarkW wrote:

It's not how to do them, it's where to put them.

I am utterly paranoid about getting it wrong again after following what was obviously bad advice (will post as soon as I can find it again)

Looks like you want per app settings - https://openbox.org/help/Applications

First make a backup of your rc.xml file.
Then when you're editing it, have a terminal open. If something goes wrong, you should be able to copy the original rc.xml file over the broken one and then restart openbox with:

openbox --restart

Get you back to Square 1.


You must unlearn what you have learned.
    -- yoda

Offline

#13 2024-11-05 20:56:33

MarkW
Member
Registered: 2024-11-03
Posts: 240

Re: I Want To Add Applications To The Openbox rc.xml File

Okay, I created this entry

<application>
  <application_name="discord">
  <decor>yes</decor>
  <shade>no</shade>
  <position_force=>"no"</position>
  <desktop>3</desktop>
</application>

But it's still starting Discord on desktop 1.

Offline

#14 2024-11-05 22:01:08

novice
Member
Registered: 2020-01-30
Posts: 61

Re: I Want To Add Applications To The Openbox rc.xml File

There are a few errors in there. Also, have you checked that "discord" is the correct name? If so, copy and paste this:

<application>
  <application name="discord">
  <decor>yes</decor>
  <shade>no</shade>
  <position force="no">
  <desktop>3</desktop>
</application>

Offline

#15 2024-11-05 22:06:40

MarkW
Member
Registered: 2024-11-03
Posts: 240

Re: I Want To Add Applications To The Openbox rc.xml File

Why do name and force turn orange in Geany?

Offline

#16 2024-11-05 22:11:43

MarkW
Member
Registered: 2024-11-03
Posts: 240

Re: I Want To Add Applications To The Openbox rc.xml File

Nope, I made the changes suggested and the application keeps stubbornly appearing on desktop 1. What am I missing?

Offline

#17 2024-11-05 22:47:00

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

Re: I Want To Add Applications To The Openbox rc.xml File

MarkW wrote:

Why do name and force turn orange in Geany?

Syntax highlighting. Most text editors designed for development work do that. Don't worry about it.

Did you use xprop to get the class for discord? Do it again and post a screenshot of the output, or post the last several lines so we can see actual output.


You must unlearn what you have learned.
    -- yoda

Offline

#18 2024-11-05 22:50:22

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

Re: I Want To Add Applications To The Openbox rc.xml File

Is discord an actual application you installed, or are you on the discord site in your browser?


You must unlearn what you have learned.
    -- yoda

Offline

#19 2024-11-05 22:57:08

MarkW
Member
Registered: 2024-11-03
Posts: 240

Re: I Want To Add Applications To The Openbox rc.xml File

Why can't I paste my imgur link?

Offline

#20 2024-11-05 23:01:27

MarkW
Member
Registered: 2024-11-03
Posts: 240

Re: I Want To Add Applications To The Openbox rc.xml File

I think I might need special permission to post the image.

Offline

Board footer

Powered by FluxBB