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
@richmarks20
Copy link

Its not actually that the button isnt working, it's a problem with the mouse pointer is in the wrong place - if you try it out on a document that contains loads of text, left click and it will highlight somehwere where the cursor is not - this is an issue logged here https://gist.github.com/zhaostu/4552236 - hopefully supported soon...

@joshbeard
Copy link

Damn, so close! If the trackpad was calibrated, it'd be fully usable on an Eee PC 901. I spent hours tinkering with various synaptics options, xorg.conf options, etc. I think the problem lies elsewhere(?)

@aosi87
Copy link

aosi87 commented Jul 18, 2013

Hi, i would like to use this script in my build, do you have any regulations about using on a personal/commercial Chromium OS build, also i will do some changes, this cause some hardware configurations does not have Internet ready (wifi, ethernet, bluetooth drivers, or maybe modules not loaded =D),

Great Work =D cheers

@zhaostu
Copy link
Author

zhaostu commented Aug 14, 2013

@aosi87 Please see the updated gist, I added LICENCE to it.

@infinitechris
Copy link

Here's what worked for me:

ALL COMMANDS AS ROOT UNLESS NOTED

/usr/share/vboot/bin/make_dev_ssd.sh --force --remove_rootfs_verification; reboot

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

ENJOY!

@ofeyvi
Copy link

ofeyvi commented Sep 9, 2013

Tried this on a Dell Mini 10V. No joy. Still no touchpad.

@infinitechris
Copy link

@ofeyvi seems like this script itself is abandonware. Hopefully Google ports some other touchpads instead of expecting their own. :[

FWIW, I updated today, tried eating my own dogfood and it didn't work, until I ran the script from this site, then the first one, and then the script from here again. The good / bad news is, if it works right, the touchpad / mouse settings will drop from "Settings"

aka: "No mouse or touchpad was detected." displayed under "chrome://settings/" in the "Device" heading.

@zhaostu
Copy link
Author

zhaostu commented Oct 25, 2013

@ofeyvi @infinitechris Sorry that this does not work for you.

I think Google does not intend this os to be running on other hardware, so they don't want to support for this and their own multitouch pad at the same time I guess.

@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