Skip to content

Instantly share code, notes, and snippets.

@zhaostu
Last active August 25, 2020 08:40
  • Star 11 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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
@Maarten86
Copy link

Hi Zhao, thanks again for this script, that makes configuring Chromium OS for use with my touchpad much easier. One thing though: I don't know much about script, but to me it seems you forgot a line of code for the Elantech touchpad. Shouldn't line 14 on config-touchpad.sh say TOUCHPAD="elantech"? I don't have a Elantech touchpad, so I'm not able to verify this, but it seems only logical to me that such a line should be there...

@zhaostu
Copy link
Author

zhaostu commented Feb 7, 2013

Thanks @Maarten86, you were definitely correct and I have fixed the problem.

Thanks again.

@addiosamigo
Copy link

when I run this command I get "file or directory not found" I'm new to linux so its obvious its something I'm doing wrong, have I got to download something first?

@AMoonRabbit
Copy link

Hi, I'm running the latest Chromium OS Vanilla builds from Hexxeh and I have a laptop with a TouchPad identified as Elantech. After running your script and rebooting, Xorg failed, and I can't start it either.

The command promt in Dev mode pretty much returns (bits omitted):

xauth: error in locking authority file /root/.serverauth.3097
xauth: error in locking authority file /root/.serverauth.3097

X.Org X Server 1.12.4
Release Date: 2012-08-27
X Protocol Version 11, Revision 0

Parse error on line 3 of section InputDevice in file /etc/X11/xorg.conf.d/50-touchpad-cmt.conf
" " is not a valid keyword in this section.

Fatal Server error:
No screens found

xinit: Giving up
xinit: unable to connect to X Server: Connection refused
xinit: server error

Any ideas?

@zhaostu
Copy link
Author

zhaostu commented Mar 19, 2013

@addiosamigo I am not sure why this happens, can you make sure that you are typing correctly?, the -qO- is "dash q oh dash".

@zhaostu
Copy link
Author

zhaostu commented Mar 19, 2013

@Razgriz375 Thanks for using this script. But sorry for the late reply. There are some weird white space in elantech.conf that should not be there. I have just fixed the problem and you should be able to use it now by running the script again.

Thank you! And sorry for the inconvenience.

@jarbro
Copy link

jarbro commented Mar 20, 2013

Seems like there is something weird going on here on my system where the touchpad isn't calibrated properly. Any ideas?

@zhaostu
Copy link
Author

zhaostu commented Mar 21, 2013

@jarbro: Yes, I am experience this as well. When clicking, the mouse are clicking at the correct position, but when moving the mouse, the highlighting is off by some distance.

Seems like it is an Aura UI problem. Someone already reported the bug here: https://code.google.com/p/chromium/issues/detail?id=180043. You can add your experience to that ticket, too. So someone might look into it.

@mikkelnl
Copy link

mikkelnl commented Apr 6, 2013

@jarbro and @zhaostu
Same here, running an hexxeh build on eeepc 1000h, haven't found a solution :(

@SCordibella
Copy link

Hi! I have the same calibration issue with asus eeePC 1011PX...
I hope someone fix this in the future, because the cros is unusable!

@mdurhamesq
Copy link

Trying the instructions I get "sh: Syntax error: newline unexpected"

I can move the cursor but buttons don't work, neither does tapping the pad.
Toshiba Satellite A100 (old workhorse)
Any Ideas?

@Lachlainn
Copy link

Anyone else having permission problems? I'm using one of the crazy Dell Mini builds.

Copy link

ghost commented May 11, 2013

Can Confirm the Bug on EEE PC 1000h.. .:(
Is there a tweak too the sources, or do i need to change something in the source too get this working?
As far as i seen, the touchpad is not even shown in the settings preferences

@kippie538
Copy link

I install hexx chromium on a Compaq CQ71, after running the synaptic-script i can move the cursor, but the buttons doesn't work.

Anyone an idea?

@wokoman
Copy link

wokoman commented May 19, 2013

Thank you zhaostu for this script! Too bad the Aura UI is broken, I'm experiencing same issue as everybody else. Good work nonetheless! Cheers!

@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