-m
This commit is contained in:
parent
07371c9c53
commit
0bf36980a1
@ -7,10 +7,14 @@ test -n "$XJIGGLER_DELAY_ACTION" \
|
||||
|| XJIGGLER_DELAY_ACTION=300 # seconds
|
||||
test -n "$XJIGGLER_DELAY_DETECTION" \
|
||||
|| XJIGGLER_DELAY_DETECTION=60 # seconds
|
||||
test -n "$XJIGGLER_KEYBOARD_ENABLED" \
|
||||
|| XJIGGLER_KEYBOARD_ENABLED='' # zero-len nonzero-len
|
||||
test -n "$XJIGGLER_MOUSE_DIRECTION" \
|
||||
|| XJIGGER_MOUSE_DIRECTION=CIRCULAR # "CIRCULAR" "DIAGONAL"
|
||||
test -n "$XJIGGLER_MOUSE_DISTANCE" \
|
||||
|| XJIGGLER_MOUSE_DISTANCE=1 # pixels
|
||||
test -n "$XJIGGLER_MOUSE_ENABLED" \
|
||||
|| XJIGGLER_MOUSE_ENABLED=yes # zero-len nonzero-len
|
||||
|
||||
# eval is scary but this use was mentioned in the man page
|
||||
getmouselocation(){
|
||||
@ -19,6 +23,8 @@ getmouselocation(){
|
||||
}
|
||||
|
||||
jiggle(){
|
||||
if test -n "$XJIGGLER_MOUSE_ENABLED"
|
||||
then
|
||||
case "$XJIGGLER_MOUSE_DIRECTION" in
|
||||
up) xdotool mousemove_relative 0 -"$XJIGGLER_MOUSE_DISTANCE"
|
||||
return ;;
|
||||
@ -35,6 +41,7 @@ jiggle(){
|
||||
*)
|
||||
false ;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
pushmouselocation(){
|
||||
@ -63,14 +70,15 @@ rotatemousedirection(){
|
||||
}
|
||||
|
||||
usage(){
|
||||
printf 'Usage: %s (-ch) (-s [action delay seconds])\n' "$0">&2
|
||||
printf 'Usage: %s (-chm) (-s [action delay seconds])\n' "$0">&2
|
||||
exit 64 # sysexits(3) EX_USAGE
|
||||
}
|
||||
|
||||
while getopts :chs: OPTION
|
||||
while getopts :chms: OPTION
|
||||
do
|
||||
case "$OPTION" in
|
||||
c) XJIGGLER_MOUSE_DIRECTION=circular ;;
|
||||
m) XJIGGLER_MOUSE_ENABLED='' ;;
|
||||
s) XJIGGLER_DELAY_ACTION="$(OPTARG)" ;;
|
||||
*) usage ;;
|
||||
esac
|
||||
|
Loading…
Reference in New Issue
Block a user