Changing the taskbar dynamically via a script

Jasper Huijsmans jasper at xfce.org
Wed Feb 25 22:59:04 CET 2004


Op di 24-02-2004, om 23:48 schreef Garton, Jamie:
> In the past when I was using KDE, I had a script that would find out the 
> exported mount points (using nfs) of a particular server, then it would 
> create icons to these auto-mounted on the desktop.
> 
> I was hoping that I could run my script from a menu icon on the panel
> and then populate all the mount points as items under that menu icon.
> 
> I thought because you can add/remove items/menus from the panel via the
> gui, there would be some command line way of doing the same thing.
> 
> Btw, this is all going to be on a Morphix liveCD so the exported mount 
> points could be different ever time it is started, depending on what 
> other machines it is connected to.
> 

That sounds very interesting. 

Well, the panel reads ~/.xfce4/xfce4rc or /etc/xfce4/xfce4rc, so you
probably could write a script that creates the menu items, before
starting xfce. That would work.

Have a look at the default xfce4rc, the format should be easy enough to
understand. Perhaps you can create a sort of pre-config file that is
transformed into the real config file on startup.

e.g., pre-xfce4rc:
===
<?xml version="1.0"?>
<Xfce>
  <Panel orientation="0" layer="0" size="1" popupposition="1"
icontheme="Curve" groups="3">
  </Panel>
  <Groups>
    <Group>
      <Popup/>
      <Control id="-2" popup="0">
        <Command term="0" sn="0">xfterm4</Command>
        <Tooltip>Terminal</Tooltip>
        <Icon id="12"/>
      </Control>
    </Group>
    <Group>
      <Popup>
      <!-- MOUNTPOINTS -->
      </Popup>
      <Control id="-2" popup="1">
        <Command term="0" sn="1">xffm</Command>
        <Tooltip>File manager</Tooltip>
        <Icon id="2"/>
      </Control>
    </Group>
    <Group>
    <Group>
      <Popup/>
      <Control id="-1" filename="libclock.so">
        <XfceClock Clock_type="2" Toggle_military="1" Toggle_am_pm="1"
Toggle_secs="0"/>
      </Control>
    </Group>
  </Groups>
</Xfce>
===

and then replace '<!-- MOUNTPOINTS -->' with the appropriate items.

	Jasper





More information about the Xfce mailing list