3 case $# in 1) ;; *) echo >&2 "usage: $1 ZOOM"; exit 2 ;; esac
10 */*) ok
=t mul
=${zoom%/*} div
=${zoom#*/} ;;
11 *) ok
=t mul
=1 div
=$zoom ;;
13 case $ok in nil
) echo >&2 "$0: bad zoom $zoom"; exit 2 ;; esac
14 case $
(( $mul > $div )) in 1) echo >&2 "$0: zoom too high"; exit 2 ;; esac
17 case ${DISPLAY-nil} in
20 *:*.
*) ok
=t dpybase
=${DISPLAY%.*} ;;
21 *:*) ok
=t dpybase
=$DISPLAY ;;
23 case $ok in nil
) echo >&2 "$0: bad DISPLAY"; exit 2 ;; esac
25 set -- $
(xqueryptr
); scr
=$1 x
=$2 y
=$3
26 DISPLAY
=$dpybase.
$scr; export DISPLAY
30 case $
(( $XWIDTH%$div ||
$XHEIGHT%$div )) in
32 *) echo >&2 "$0: zoom divisor doesn't divide screen size"; exit 2 ;;
37 while read _ _ respos name
; do
38 res
=${respos%%+*} pos
=${respos#*+}
39 ww
=${res%x*} hh
=${res#*x}
41 x0
=${pos%+*} y0
=${pos#*+}
42 x1
=$
(( $x0 + $w )) y1
=$
(( $y0 + $h ))
43 case $
(( $x0 <= $x && $x < $x1 && $y0 <= $y && $y < $y1 )) in
48 $(xrandr --listmonitors)
51 case $found in nil
) echo >&2 "$0: pointer not on any screen?"; exit 2 ;; esac
53 case $
(( $mul == $div )) in
55 *) pan
="--panning ${XWIDTH}x${XHEIGHT}" ;;
58 xrandr
--fb
${XWIDTH}x
${XHEIGHT} \
60 --mode $
(( $mul*$XWIDTH/$div ))x$
(( $mul*$XHEIGHT/$div )) \