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 / Matrox_DualHead_DriverOptions.pl < prev    next >
Perl Script  |  2006-11-29  |  2KB  |  83 lines

  1. #!/usr/bin/perl
  2.  
  3. use lib '/usr/share/sax/profile';
  4.  
  5. use strict;
  6. use Profile;
  7.  
  8. #====================================
  9. # Profile name...
  10. #------------------------------------
  11. my $name = "Matrox_DualHead_DriverOptions";
  12.  
  13. #====================================
  14. # Init profile script
  15. #------------------------------------
  16. my $profile = ProfileInitScript();
  17.  
  18. #====================================
  19. # Do the profile adaptions...
  20. #------------------------------------
  21. #====================================
  22. # check secondary DDC data
  23. #------------------------------------
  24. open (FD,">>",$profile) ||
  25.     die "$name: Can't open $profile: $!";
  26. my %data   = ProfileGetDDC2Data();
  27. my $id = 20;
  28. my $dt = '"Device->[X]->Raw->".$id++."->Option"';
  29. my $dx = eval $dt;
  30. print FD "$dx=\"MergedFB\" \"yes\"\n";
  31. $dx = eval $dt;
  32. print FD "$dx=\"Monitor2Position\" \"Clone\"\n";
  33. $dx = eval $dt;
  34. print FD "$dx=\"SaXDualOrientation\" \"LeftOf\"\n";
  35. $dx = eval $dt;
  36. print FD "$dx=\"SaXDualMode\" \"Clone\"\n";
  37. $dx = eval $dt;
  38. foreach my $key (keys %data) {
  39.     my $val = $data{$key};
  40.     SWITCH: for ($key) {
  41.         /^Model/      && do {
  42.             $id = 31;
  43.             $dx = eval $dt;
  44.             print FD "$dx=\"SaXDualMonitorModel\" \"$val\"\n";
  45.             last SWITCH;
  46.         };
  47.         /^Vendor/     && do {
  48.             $id = 30;
  49.             $dx = eval $dt;
  50.             print FD "$dx=\"SaXDualMonitorVendor\" \"$val\"\n";
  51.             last SWITCH;
  52.         };
  53.         /^Resolution/ && do {
  54.             $id = 26;
  55.             $dx = eval $dt;
  56.             print FD "$dx=\"MetaModes\" \"\${Modes[0]}-$val\"\n";
  57.             $id = 29;
  58.             $dx = eval $dt;
  59.             print FD "$dx=\"SaXDualResolution\" \"$val\"\n";
  60.             last SWITCH;
  61.         };
  62.         /^Hsync/      && do {
  63.             $id = 24;
  64.             $dx = eval $dt;
  65.             print FD "$dx=\"Monitor2HSync\" \"$val\"\n";
  66.             $id = 27;
  67.             $dx = eval $dt;
  68.             print FD "$dx=\"SaXDualHSync\" \"$val\"\n";
  69.             last SWITCH;
  70.         };
  71.         /^Vsync/      && do {
  72.             $id = 25;
  73.             $dx = eval $dt;
  74.             print FD "$dx=\"Monitor2VRefresh\" \"$val\"\n";
  75.             $id = 28;
  76.             $dx = eval $dt;
  77.             print FD "$dx=\"SaXDualVSync\" \"$val\"\n";
  78.             last SWITCH;
  79.         };
  80.     }
  81. }
  82. close FD;
  83.