#!/bin/sh
[ ! -s $HOME/.jwm/corners/leftbottom ] && exit
set -a

start (){
	#delay to see if user really wants to activate corner app
	sleep 0.4
	#find height of screen
	HEIGHT=`xwininfo -root | grep -m 1 '\geometry' | cut -f4 -d ' ' | cut -f2 -d 'x' | cut -f1 -d '+'`
	MAX_Y=$((HEIGHT-10))
	#exit if mouse is not in corner
	[ `getcurpos | cut -d' ' -f2` -lt $MAX_Y ] && exit
	[ `getcurpos | cut -d' ' -f1` -gt 10 ] && exit
	#execute user-defined command
	$HOME/.jwm/corners/leftbottom
}

export Corner_LeftBottom='
<window width-request="2" height-request="2">
 <text><label>""</label></text>
 <action signal="enter-notify-event">start</action>
</window>'
gtkdialog -p Corner_LeftBottom --name=cornerleftbottom
