blob: 41714d62ef57c1fb9af67ee4d94d02797d604442 [file] [log] [blame]
Andrew de los Reyes392288b2012-01-21 00:04:511#!/bin/sh
2# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
Daniel Kurtzaa13e902012-03-14 18:15:526# Log all calls, with arguments, to /var/log/messages
7logger "$0" "$@"
8
Andrew de los Reyes392288b2012-01-21 00:04:519SYNCLIENT=/usr/bin/synclient
10
11PROG=`basename $0`
12COMMAND=$1
13VALUE=$2
14
15echo_setting() {
16 echo $1: `$SYNCLIENT $1`
17}
18
19usage() {
20 echo "Usage: $PROG {status|taptoclick [on|off]|sensitivity [1-5]}"
21}
22
23VALID=0
24
25if [ "$COMMAND" = "status" ] ; then
26 $SYNCLIENT -l
27 VALID=1
28elif [ "$COMMAND" = "taptoclick" ] ; then
29 if [ "$VALUE" = "on" ] ; then
30 $SYNCLIENT "MaxTapTime=180"
31 VALID=1
32 elif [ "$VALUE" = "off" ] ; then
33 $SYNCLIENT "MaxTapTime=0"
34 VALID=1
35 fi
36elif [ "$COMMAND" = "sensitivity" ] ; then
37 case $VALUE in
38 1)
39 $SYNCLIENT "MinSpeed=0.5"
40 $SYNCLIENT "MaxSpeed=1.0"
41 $SYNCLIENT "AccelFactor=0.015"
42 $SYNCLIENT "VertScrollDelta=36"
43 VALID=1
44 ;;
45 2)
46 $SYNCLIENT "MinSpeed=0.8"
47 $SYNCLIENT "MaxSpeed=1.5"
48 $SYNCLIENT "AccelFactor=0.03"
49 $SYNCLIENT "VertScrollDelta=27"
50 VALID=1
51 ;;
52 3)
53 $SYNCLIENT "MinSpeed=1"
54 $SYNCLIENT "MaxSpeed=2"
55 $SYNCLIENT "AccelFactor=0.045"
56 $SYNCLIENT "VertScrollDelta=18"
57 VALID=1
58 ;;
59 4)
60 $SYNCLIENT "MinSpeed=1.5"
61 $SYNCLIENT "MaxSpeed=3"
62 $SYNCLIENT "AccelFactor=0.06"
63 $SYNCLIENT "VertScrollDelta=9"
64 VALID=1
65 ;;
66 5)
67 $SYNCLIENT "MinSpeed=2"
68 $SYNCLIENT "MaxSpeed=5"
69 $SYNCLIENT "AccelFactor=0.075"
70 $SYNCLIENT "VertScrollDelta=4"
71 VALID=1
72 ;;
73 esac
74fi
75
76if [ $VALID = 0 ] ; then
77 usage
78fi