aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/data/scripts/util/uzbl-window.sh
blob: 856e5fadc7112ba9362ae7bd9288868e7ad7b84c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh
# uzbl window detection

. "$UZBL_UTIL_DIR/uzbl-util.sh"

UZBL_WIN_POS="$( xwininfo -id "$UZBL_XID" | \
                 sed -n -e '[ ]*s/Corners:[ ]*[+-]\([0-9]*\)[+-]\([0-9]*\).*$/\1 \2/p' )"
UZBL_WIN_SIZE="$( xwininfo -id "$UZBL_XID" | \
                  sed -n -e '[ ]*s/-geometry[ ]*\([0-9]*\)x\([0-9]*\).*$/\1 \2/p' )"
UZBL_WIN_POS_X="$( print "$UZBL_WIN_POS" | cut -d ' ' -f 1 )"
UZBL_WIN_POS_Y="$( print "$UZBL_WIN_POS" | cut -d ' ' -f 2 )"
UZBL_WIN_WIDTH="$( print "$UZBL_WIN_SIZE" | cut -d ' ' -f 1 )"
UZBL_WIN_HEIGHT="$( print "$UZBL_WIN_SIZE" | cut -d ' ' -f 2 )"