Just a short script I wrote to disable my mouse to get me into better workflow habits - Programming On Unix

Users browsing this thread: 1 Guest(s)
Wildefyr
Long time nixers
Made the script use wmp (from wmutils) and it performs much better than using xdotool:

Code:
while :; do
    case $1 in
        -e|--enable)
            wmp 960 540
            xinput set-int-prop $(xinput | awk '/Mouse/ {printf "%s",$9}' | sed 's/id=//') "Device Enabled" 8 1
            break
            ;;
        -d|--disable)
            wmp $(xrandr | awk '/Screen 0/ {printf "%s",$8 " " $10}' | sed 's/,$//')
            xinput set-int-prop $(xinput | awk '/Mouse/ {printf "%s",$9}' | sed 's/id=//') "Device Enabled" 8 0
            break
            ;;
        *)
            echo "Usage: ./mouse [option]:

-e | --enable: Enable Mouse
-d | --disable: Disable Mouse"
            break
    esac
done


Messages In This Thread
RE: Just a short script I wrote to disable my mouse to get me into better workflow habits - by Wildefyr - 11-05-2015, 02:25 AM