#!/usr/bin/perl use 5.8.8; use strict; use warnings; my $num=0; my $buf; my $ind; system("touch automouse.txt"); system("xinput --list > automouse.txt"); open(FIL,"automouse.txt"); while() { if($_ =~ m/A4Tech/i) { $num++; if($num==2) { $ind = index ($_, "=1"||"=2"||"=3"||"=4"||"=5"||"=6"||"=7"||"=8"||"=9"); $buf = substr ($_, $ind+1, 2); system("xinput set-int-prop $buf 'Device Enabled' 8 0"); close (FIL); } } } close(FIL); $buf=""; $num=0; $ind=0; system("rm automouse.txt"); exit( 0 );