#!/bin/sh # ctlmouse - disable mouse nicely # # For full functionality you need the pwarp util which will # move your pointer out of view when disabling the mouse and # back to the middle of the screen after reenabling it. # Get it on http://mychie2.net # # Please adjust MODULE to fit your pointer device. # # To install, copy file to ~/.wmii-3.5/ directory and add # # Key $MODKEY-Control-m # ~/.wmii-3.5/ctlmouse toggle & # # to the `eventstuff` section of your wmiirc. WMIIDIR="$HOME/.wmii-3.5" LOCKFILE="$WMIIDIR/.lockmouse" MODULE="psmouse" if [ "$1" = "toggle" ]; then if [ ! -e "$LOCKFILE" ]; then sudo modprobe -r $MODULE pwarp 100 100 touch "$LOCKFILE" else sudo modprobe $MODULE pwarp 50 50 rm "$LOCKFILE" fi elif [ "$1" = "autostart" ]; then if [ -e "$LOCKFILE" ]; then sudo modprobe -r $MODULE pwarp 100 100 touch "$LOCKFILE" fi elif [ "$1" = "test" ]; then if [ -e "$LOCKFILE" ]; then echo "lock" fi else exit 1 fi