User Tools

Site Tools


user:bh011695:xpaint
xpaint.sh
#!/bin/bash
#
pkill xpaint
#Moves the mouse cursor to the top left corner. This will make Xpaint open here.
xwit -root -warp 1 1
#Grabs desktop dimensions
desktopHeight=`xwininfo -root | grep 'Height' | sed -e 's/.*:\ //g'`
desktopWidth=`xwininfo -root | grep 'Width' | sed -e 's/.*:\ //g'`
#Dimensions of the XPaint Window. These never change
XPAINT_WIDTH=124
XPAINT_HEIGHT=406
#These dimensions are used to get the canvas to snap to the xpaint window and also fill the screen.
canvasWidth=$(($desktopWidth-$XPAINT_WIDTH-15))
#Open XPaint in the background desired size
xpaint -popped -size ${canvasWidth}x${desktopHeight} &
sleep 3s
#Grabs the XPaint widget Window ID
xpaintWinID=`xwit -print -all | grep 'XPaint' | sed -e 's/:.*//g'`
#Grabs the canvas Window ID
canvasWinID=`xwit -print -all | grep 'Untitled' | sed -e 's/:.*//g'`
desktopSize=`xwininfo -root | grep '\-geometry' | sed -e 's/^.*\ //g' | sed -e 's/+.*//g'`
#This is where I want the canvas Window to move to
canvasXPosition=$(($XPAINT_WIDTH+1))
canvasYPosition=1
#Snaps Xpaint Widget to the edge of the screen
xwit -id $xpaintWinID -move 1 1
#Moves the canvas window so that it snaps to the XPaint window                                                                               
xwit -id $canvasWinID -move $canvasXPosition 1
sleep 3s
user/bh011695/xpaint.txt · Last modified: 2010/03/25 14:44 by bh011695