#!/bin/bash
. ./lib

if ( confirm "MadCatz R.A.T.7 patch for xorg. This correct the stop working mouse bug after start X session.\n\nCreate /usr/share/X11/xorg.conf.d/50-madcatzrat7.conf ?" ) then
cat << EOF > /usr/share/X11/xorg.conf.d/50-madcatzrat7.conf
Section "InputClass"
  Identifier "Mad Catz R.A.T.7"
  MatchProduct "Mad Catz R.A.T.7 Mouse"
  MatchDevicePath "/dev/input/event*"
  Option "Buttons" "17"
  Option "ButtonMapping" "1 2 3 4 5 0 0 8 9 7 6 12 0 0 0 16 17"
  Option "AutoReleaseButtons" "13 14 15"
  Option "ZAxisMapping" "4 5 6 7"
EndSection
EOF
fi

exit 0