#!/bin/bash
#############################################
#                                           #
#  Starts an application maximized.         #
#                                           #
#  Koentje  (remon@cobrasoft.nl)            #
#                                           #
#############################################

x=0
gnome-calculator &

while [ "$(ps aux | grep 'gnome-calculator' | grep -v grep)" = "" ]
do
    echo "Waiting..." > /dev/null
    sleep 1
    if [ "$x" -gt "30" ]; then exit; fi
    x=$((x+1))
done

pid=$(ps aux | grep gnome-calculator | grep -v grep | awk '{print $2}')

xdotool windowsize $(wmctrl -lp | grep $pid | awk '{print $1}') 100% 100%
