#!/bin/sh
#
# /etc/hotplug/usb/logitech_mouse
#
# Sets up higher resolution for the mouse
# 46d/xxxx/*
#

# wait for the mouse
sleep 3

# path to the logitech applet
APPLET=/usr/bin/logitech_applet

# pre-renumeration device IDs
case $PRODUCT in
# HAS_RES (variable resolution)
46d/c00e/*|46d/c00f/*|46d/c012/*|46d/c01b/*|46d/c024/*|46d/c031/*)
  OPTIONS="--set-res=800"
  ;;

# HAS_RES | HAS_SS | HAS_SSR (variable resolution, smart scroll control,
# smart scroll reporting)
46d/c01d/*|46d/c025/*)
  OPTIONS="--set-res=800 --disable-cc"
  ;;
  
# HAS_SS | HAS_SSR (smart scroll control, smart scroll reporting)
46d/c505/*|46d/c506/*|46d/c508/*|46d/c50b/*|46d/c50e/*)
  OPTIONS="--disable-cc"
  ;;

*)
  if [ -x /usr/bin/logger ]; then
    /usr/bin/logger -t $0 "unknown product $PRODUCT"
  fi
  exit 1
  ;;

esac

# has USB device been added or removed
case $ACTION in
add)
  # if options are set
  test -n "$OPTIONS" && $APPLET $OPTIONS
  ;;
  
remove)
  ;;

esac
