#!/bin/sh
# spawn a new terminal window inside a drawn rectangle
# edit the part with urxvt to match your terminal

set -e

wglyph=6        # glyph width, in pixels
hglyph=10       # glyph height, in pixels
border=2       # border width, in pixels
title=0        	# titlebar height, in pixels

slop -o -b 2 | tr 'x+' ' ' | {
	read w h x y
	w=$(( w / wglyph - border ))
	h=$(( h / hglyph - border ))
	exec st -g ${w}x${h}+${x}+${y} &
}

#P.S i have no idea about actual orgin of this script
