#!/bin/bash

class=$1
x=$2
y=$3
width=$4
height=$5

patch=0
if [ "$class" = "XTerm" ]
then
	patch=13
fi

current=$(( $width * $height ))

echo "Raise"

target=$(( (1280 + $patch) * (1024 + $patch) ))
if [ $current -gt $target ]
then
	echo "ResizeMove frame 1280p 1024p 50-50w 50-50w"
	exit
fi

target=$(( (1024 + $patch) * (768 + $patch) ))
if [ $current -gt $target ]
then
	echo "ResizeMove frame 1024p 768p 50-50w 50-50w"
	exit
fi

target=$(( (960 + $patch) * (600 + $patch) ))
if [ $current -gt $target ]
then
	echo "ResizeMove frame 960p 600p 50-50w 50-50w"
	exit
fi

target=$(( (800 + $patch) * (600 + $patch) ))
if [ $current -gt $target ]
then
	echo "ResizeMove frame 800p 600p 50-50w 50-50w"
	exit
fi

echo "ResizeMove frame 800p 600p 50-50w 50-50w"

