You are not logged in.
I have a customised openbox menu and tinker with it often. The traditional way to hide or disable an item in the menu involves editting the menu.xml file and "commenting out" the xml section describing the menu item:
SNIPPET:
<!-- DISABLE
<item label="Terminal">
<!-- Debian configured terminal -->
<action name="Execute">
<execute>x-terminal-emulator</execute>
</action>
</item>
-->
If you are familiar with this process, you may notice the error in this code snippet. Comments cannot be embedded; openbox pukes with an error. To correct the problem, the inner "-->" must be changed to something else (or the comment removed altogether). When re-enabled, the inner comment must be repaired (or added back).
A better alternative: change the name of the enclosing xml <item>..</item> tags to something unrecognised by the OB menu parser, like <null>..</null> or even the more descriptive <DISABLED.item>..</DISABLED.item>. It requires no enclosing comments; no altering/reverting embedded comments; is easily reverted with a sed command; and can be self-documenting with appropriate tag names.
As the xml is correctly formed, openbox ignores what it doesn't understand and loads the rest correctly. Likewise for obmenu which both ignores and preserves these unrecognized xml sections.
Furthermore, this is not limited to menus but also works in rc.xml. Typically I disable keys or mouse movements. But as an experiment, I disabled the entire <theme> section as <DISABLED.theme>; OB was well-behaved and fell back to the default values in /etc/xdg/openbox). As obconf and lxappearance-obconf muck about with the <theme> section, I expect incompatibility - but this is true of commenting out parts of the <theme> section as well.
Offline
Nice tip, thanks!
Moved to Scripts, Tutorials & Tips
Offline
thanks for the hint, appreciated.
since this file is only parsed once when openbox starts or is reconfigured, there will be no added delay.
i like that.
As obconf and lxappearance-obconf muck about with the <theme> section, I expect incompatibility
i guess it will just create a complete new <theme> section?
Offline
Excellent tip! Thank you.
This makes scripted editing easier too.
...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 )
Offline