#!/bin/sh # Start/stop dock apps. This will let you specify where in the dock they will be placed. declare -a apps apps[1]="wmdrawer" apps[2]="volume.app -c 1" apps[3]="pop3eye -w" apps[4]="stickytime -w" num_apps=${#apps[@]} case "$1" in start) echo "Starting $num_apps dock apps" while [ $num_apps -gt 0 ]; do let x=0 ${apps[$num_apps]} >/dev/null & appname=`echo "${apps[$num_apps]}" | cut -d" " -f-1` echo $appname until xwininfo -name $appname >/dev/null 2>&1 do sleep 0.1 ; let x=++x; if [ $x = 10 ]; then break; fi done let "num_apps -= 1" done ;; stop) echo "Stopping $num_apps dock apps" while [ $num_apps -gt 0 ]; do killall $(echo ${apps[$num_apps]} | awk '{print $1}') >/dev/null 2>&1 & let "num_apps -= 1" done ;; restart) $0 stop sleep 1; $0 start ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 ;; esac exit 0