Skip to content

Instantly share code, notes, and snippets.

@zhaostu
Last active August 25, 2020 08:40
Show Gist options
  • Save zhaostu/4552236 to your computer and use it in GitHub Desktop.
Save zhaostu/4552236 to your computer and use it in GitHub Desktop.
Configure Synaptics/ALPS/ElanTech touchpad for Chromium OS.

Configure Synaptics/ALPS/ElanTech touchpad for Chromiums OS

Note: Many users including me are experiencing alignment issue with touchpad after running this script. That is, the cursor would not show up at where it actually is. Using a USB mouse, however, does not have this problem. There is no known fix yet. If you know a fix, please tell me. Please.

As the vanilla Chromium OS builds defaults to the "cmt" driver, on many laptops the touchpad won't work out of box. This script configures Synaptics/ALPS/Elantech touchpad for your Chromium OS. The script can detect which brand the touchpad you have and install the proper configuration.

Credit goes to ArnoldTheBat as he published the solution here. This script automates the configuration process and (hopefully) installs more generic configurations.

Usage

First you need to become a root user:

  • Press Ctrl + Alt + F2 (You can press Ctrl + Alt + F1 to come back).
  • Enter username chronos
  • Enter password facepunch for Hexxeh builds or password for ArnoldTheBat builds.
  • sudu su
  • Enter the above password again.

Run the following as root user:

wget -qO- http://goo.gl/C7PoB | sh

Then reboot, and enjoy your touchpad.

Notes

Section "InputDevice"
Driver "synaptics"
Identifier "TouchPad"
Option "SendCoreEvents"
Option "Protocol" "auto-dev"
Option "SHMConfig" "on"
Option "LeftEdge" "130"
Option "RightEdge" "840"
Option "TopEdge" "130"
Option "BottomEdge" "640"
Option "FingerLow" "7"
Option "FingerHigh" "8"
Option "MaxTapTime" "180"
Option "MinTapTime" "110"
Option "ClickTime" "0"
Option "EmulateMidButtonTime" "75"
Option "VertScrollDelta" "20"
Option "HorizScrollDelta" "20"
Option "MinSpeed" "0.40"
Option "MaxSpeed" "0.65"
Option "AccelFactor" "0.030"
Option "EdgeMotionMinSpeed" "200"
Option "EdgeMotionMaxSpeed" "200"
Option "UpDownScrolling" "1"
Option "CircularScrolling" "1"
Option "CircScrollDelta" "0.1"
Option "CircScrollTrigger" "3"
Option "VertEdgeScroll" "on"
Option "HorizEdgeScroll" "on"
Option "TapButton1" "1"
Option "TapButton2" "2"
Option "TapButton3" "3"
EndSection
#!/bin/sh
CONFIG_FILE="/etc/X11/xorg.conf.d/50-touchpad-cmt.conf"
# Check which type of touchpad is present.
if grep -qi synaptics /proc/bus/input/devices; then
echo "Synaptics touchpad detected."
TOUCHPAD="synaptics"
elif grep -qi alps /proc/bus/input/devices; then
echo "ALPS touchpad detected."
TOUCHPAD="alps"
elif grep -qi elantech /proc/bus/input/devices; then
echo "Elantech touchpad detected."
TOUCHPAD="elantech"
else
echo "No known touchpad found, exiting."
exit
fi
echo "Mounting the rootfs as read-write..."
mount -o remount, rw /
if [ ! -e "$CONFIG_FILE.bak" ]; then
echo "Creating backup for $CONFIG_FILE..."
cp $CONFIG_FILE $CONFIG_FILE.bak
fi
echo "Downloading the configuration file for your touchpad..."
rm $CONFIG_FILE
wget -qO $CONFIG_FILE https://gist.github.com/raw/4552236/$TOUCHPAD.xorg.conf
echo "Configuration finished. Please reboot to make the change effective."
Section "InputDevice"
Driver "synaptics"
Identifier "Touchpad"
Option "SendCoreEvents"
Option "Protocol" "auto-dev"
Option "SHMConfig" "on"
Option "VertTwoFingerScroll" "1"
Option "HorizTwoFingerScroll" "1"
Option "TapButton1" "1"
Option "TapButton2" "2"
Option "TapButton3" "3"
Option "AreaTopEdge" "50"
EndSection
Copyright (c) 2013, Stu Zhao
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Section "InputDevice"
Driver "synaptics"
Identifier "TouchPad"
Option "SendCoreEvents"
Option "Protocol" "auto-dev"
Option "SHMConfig" "on"
Option "LeftEdge" "1900"
Option "RightEdge" "5400"
Option "TopEdge" "1400"
Option "BottomEdge" "4500"
Option "FingerLow" "25"
Option "FingerHigh" "30"
Option "MaxTapTime" "180"
Option "MaxTapMove" "220"
Option "VertScrollDelta" "100"
Option "MinSpeed" "0.02"
Option "MaxSpeed" "0.18"
Option "AccelFactor" "0.0010"
Option "TapButton1" "1"
Option "TapButton2" "2"
Option "TapButton3" "3"
EndSection
@Quiter
Copy link

Quiter commented May 6, 2014

Before I used this I could not move the mouse on my eeePC 1000H but now I can move the mouse but can't click neither with the buttons nor the touchpad.
I hope you can help me with this problem.

@PJ-Oscheh
Copy link

Hi, I ran this script, and it detected I had a Synaptics touchpad, remounted the file system, and downloaded the config file, but nothing happened. I am a bit of a noob with Chromium OS and have little linux experience, so please forgive me, and please help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment