Here's how I did it. I just added my information to /usr/share/wbar/dot.wbar. There are three entries per button:
i: = image
t: = text
c: = command
Then make dot.wbar persistent using the backup system or by creating a custom tce extension containing all changed system files.
Note the png is 48x48 pixels at 72 dpi.
# The Bar && Font && Font size (11)
i: /usr/share/wbar/osxbarback.png
t: /usr/share/fonts/luxisr/11
c:
i: /usr/share/wbar/aterm.png
t: Aterm
c: exec /usr/bin/aterm
i: /usr/share/wbar/cpanel.png
t: Panel
c: exec /usr/bin/cpanel
i: /usr/share/wbar/appbrowser.png
t: Apps
c: exec /usr/bin/appbrowser
i: /mnt/sdc1/mywbar/samba-wbar-active.png
t: S
c: exec /mnt/sdc1/mywbar/samba-wbar &
My button toggles between two colors to show the state of the program that gets activated by displaying two different images. The script below (samba-wbar) uses three images on, off and active to support the toggle function.
#!/bin/sh
#bigpcman May 28, 2009
start(){
/mnt/sdc1/samba/samba_server start 2>&1 > /dev/null &
sleep 4
sudo cp -f /mnt/sdc1/mywbar/samba-wbar-on.png /mnt/sdc1/mywbar/samba-wbar-active.png 2>&1 > /dev/null &
/usr/bin/wbar.sh 2>&1 > /dev/null &
}
stop(){
/mnt/sdc1/samba/samba_server stop 2>&1 > /dev/null &
sleep 4
sudo cp -f /mnt/sdc1/mywbar/samba-wbar-off.png /mnt/sdc1/mywbar/samba-wbar-active.png 2>&1 > /dev/null &
/usr/bin/wbar.sh 2>&1 > /dev/null &
}
PID=$(pidof smbd)
[ -n "$PID" ] && stop || start
edit: Note the "active image" should be initialized by a custom tce or by a cp command in the bootlocal script to make sure it is in the correct state after a bootup.