home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / boot / i386 / root / usr / share / sax / profile / synaptics.pl < prev    next >
Perl Script  |  2006-11-29  |  1KB  |  34 lines

  1. #!/usr/bin/perl
  2.  
  3. use lib '/usr/share/sax/profile';
  4.  
  5. use strict;
  6. use Profile;
  7.  
  8. #====================================
  9. # Init profile script
  10. #------------------------------------
  11. my $profile = ProfileInitScript();
  12.  
  13. #====================================
  14. # Add default mouse if needed
  15. #------------------------------------
  16. qx(/usr/sbin/sysp -q mouse | grep Profile | grep -qi "<undefined>");
  17. my $code = $? >> 8;
  18. if ($code != 0) {
  19.     open (FD,">>",$profile) ||
  20.         die "synaptics: Can't open $profile: $!";
  21.     my $i="InputDevice";
  22.     my $l="ServerLayout";
  23.     print FD "$i->\[X+2\]->Identifier = Mouse[[X+2]]\n";
  24.     print FD "$i->\[X+2\]->Driver     = mouse\n";
  25.     print FD "$i->\[X+2\]->Option->InputFashion = Mouse\n";
  26.     print FD "$i->\[X+2\]->Option->ZAxisMapping = 4 5\n";
  27.     print FD "$i->\[X+2\]->Option->ButtonNumber = 5\n";
  28.     print FD "$i->\[X+2\]->Option->Device = /dev/input/mice\n";
  29.     print FD "$i->\[X+2\]->Option->Name = USB-Mouse;ExplorerPS/2 on USB\n";
  30.     print FD "$l->all->InputDevice->[X+2]->id = Mouse[[X+2]]\n";
  31.     print FD "$l->all->InputDevice->[X+2]->usage = SendCoreEvents\n";
  32.     close FD;
  33. }
  34.