Bespin - XBar

Custom <XML/> menu

The global menu supports a customizable menu, found in ~/.kde/share/apps/XBar/MainMenu.xml.
The structure is:

        <menubar>
        <menu [label|menu]="???">
            [<menu [label|menu]="???"/>]
            [<action label="???" [exec|dbus]="???"/>]
            [<separator/>]
        </menu>
        </menubar>
            

The first node is always "<menubar>"

To add a menu entry, add a "<menu>" node, this will add a popup menu.

It's attributes can be either

menu
A reference to another xml file, following this very same structure (i.e. "inherit" another file)
The path is relative to ~/.kde/share/apps/XBar/ and an ".xml" suffix is applied automatically, eg. "subpath/submenu" turns to "~/.kde/share/apps/XBar/subpath/submenu.xml"
label
A label for the popup entry, defined in the following subnodes
windowlist
Adds a window list, generated by XBar

The actual popup menu entries can be subnodes

<menu>
Yet another submenu
<action>
An active item, that actually triggers sth., can also be put directly into the <menubar> node, though this is rather uncommon.

It's attributes can be either
label
A label for the entry, overriding that in any given service
icon
An icon for the entry, overriding that in any given service
dbus
A dbus call, separate by semicolons.
<bus>;<service>;<path>;<interface>;<method>[;<parameter_1>[;<parameter_2>[;...]]]
exec
either a service name or an executable, or a path, or ... basically anything you can type into krunner or konqueror, ie. "gg:KDE" will google for KDE!
If this is a service, it's label and icon can be overridden by the related attributes
<separator>
Yeah... guess what.

Example:

    <menubar>
        <menu menu="MainMenu/kate"/>
        <menu label="Desktop">
            <action label="XTerm" exec="xterm"/>
            <action label="Toggle FX" dbus="session;org.kde.kwin;/KWin;org.kde.KWin;toggleCompositing"/>
            <separator/>
            <action label="Run Conky" exec="conky -c $HOME/.conky/mytop.conf"/>
            <action label="Quit Conky" exec="killall conky"/>
        </menu>
        <action label="Edit Menu" exec="kwrite $HOME/.kde/share/apps/XBar/MainMenu.xml"/>
    </menubar>