#!/bin/zsh
# why zsh? bash does not support floating numbers

# aptitude install wmctrl iceweasel gnome-games gnome-control-center
# aptitude install openoffice.org # and uncomment the oo* lines


read T0 T1 < /proc/uptime

function progress()
{
	read t0 t1 < /proc/uptime
	t=$((t0 - T0))
	printf "%8.2f    " $t
	echo "$@"
}

function switch_windows()
{
	wmctrl -l | while read a b c win
	do
		progress A "$win"
		wmctrl -a "$win"
	done
	# firefox /usr/share/doc/debian/FAQ/index.html
}

while read app args
do
	progress N $app $args
	pidof $app || $app $args &
	switch_windows
done << EOF
xeyes
firefox
nautilus
nautilus --browser
gthumb
gedit
xpdf /usr/share/doc/shared-mime-info/shared-mime-info-spec.pdf

xterm
mlterm
gnome-terminal
urxvt

gnome-system-monitor
gnome-help
gnome-dictionary

/usr/games/sol
/usr/games/gnometris
/usr/games/gnect
/usr/games/gtali
/usr/games/iagno
/usr/games/gnotravex
/usr/games/mahjongg
/usr/games/gnome-sudoku
/usr/games/glines
/usr/games/glchess
/usr/games/gnomine
/usr/games/gnotski
/usr/games/gnibbles
/usr/games/gnobots2
/usr/games/blackjack
/usr/games/same-gnome

/usr/bin/gnome-window-properties
/usr/bin/gnome-default-applications-properties
/usr/bin/gnome-at-properties
/usr/bin/gnome-typing-monitor
/usr/bin/gnome-at-visual
/usr/bin/gnome-sound-properties
/usr/bin/gnome-at-mobility
/usr/bin/gnome-keybinding-properties
/usr/bin/gnome-about-me
/usr/bin/gnome-display-properties
/usr/bin/gnome-network-preferences
/usr/bin/gnome-mouse-properties
/usr/bin/gnome-appearance-properties
/usr/bin/gnome-control-center
/usr/bin/gnome-keyboard-properties

: oocalc
: oodraw
: ooimpress
: oomath
: ooweb
: oowriter    

EOF
