I recently acquired a HP EliteBook 9470m (before you ask: it's personal), and installed FreeBSD on it. The Synaptics touchpad is detected on FreeBSD as a PS/2 mouse on both laptops, and unlike the 2570p I was coming from, the 9470m doesn't automatically fallback to edge scrolling. While web browsers make up by making it easy to scroll with the arrow keys, other applications (such as email) end up doing actions you might not want with the arrow keys.
scrollify.py is not yet on FreeBSD Ports, you will have to install it manually.
First, you need
pip. To install this, run either:
pkg install py27-pip py27-xlib
cd /usr/ports/devel/python-pip make config-recursive install clean cd /usr/ports/x11-toolkits/py-xlib make config-recursive install clean
Then you need to install the Python module
pynput. This is used for controlling the keyboard and mouse from Python, and is not in Ports either. To install this, run this as a normal user:
pip install --user pynput
Next, you will need
xbindkeys in order to do the mapping. To install this, run:
pkg install xbindkeys
cd /usr/ports/x11/xbindkeys make config-recursive install clean
Finally, you should install
scrollify.py somewhere on your system. For example, if you want it in
mkdir -p ~/.local/bin cd ~/.local/bin fetch --no-verify-peer https://raw.githubusercontent.com/neelchauhan/scrollify/master/scrollify.py
You will need to modify
.xbindkeysrc. To do that, run:
and add the following:
"python2.7 ~/.local/bin/scrollify.py up" alt + Up "python2.7 ~/.local/bin/scrollify.py down" alt + Down
vim with your text editor of choice,
~/.local/bin to the place you stored
alt + Up and
alt + Down to your desired key combination (you can Google search the possible combinations). This will map the scroll up to Alt + Up and scroll down to Alt + Down.
You finally need to make your window manager or desktop environment (GNOME for me) launch
xbindkeys on startup. For instance, on GNOME, make the directory
~/.config/autostart if it doesn't exist, create a
.desktop file in the directory with the following content:
[Desktop Entry] Name=xbindkeys GenericName=Keyboard Bindings Comment=Keybindings Exec=/usr/local/bin/xbindkeys Terminal=false Type=Application X-GNOME-Autostart-enabled=true
.desktop file you created to
~/.local/applications. This ensures that GNOME (or whatever DE you use) can see the startup script.
On your specific WM or DE, this can be found on the Internet. Arch Linux's wiki has a page on startup scripts for all the major DEs (and I believe the information should be common on FreeBSD as well). Keep in mind that there is a delay (~1sec) when scrolling with this method.
I may update this page once
pynput makes it to FreeBSD Ports (I am a maintainer), but in the meanwhile, that's it.
UPDATE: An update to
pynput has broke FreeBSD. The error I get is:
Traceback (most recent call last): File "/home/neel/.local/bin/scrollify.py", line 20, in <module> mouse.scroll(0, scroll_amt) File "/home/neel/.local/lib/python2.7/site-packages/pynput/mouse/_base.py", line 78, in scroll self._scroll(dx, dy) File "/home/neel/.local/lib/python2.7/site-packages/pynput/mouse/_xorg.py", line 75, in _scroll self._check_bounds(dx, dy) File "/home/neel/.local/lib/python2.7/site-packages/pynput/mouse/_xorg.py", line 103, in _check_bounds raise ValueError() ValueError
You can track the bug on GitHub.
pynput works now. Ignore the first UPDATE message.
UPDATE 3: There is an experimental patch which enables the Synaptics on the 9470m (as as well as other HP EliteBooks with a pointing stick like the 2570p, 8470p, and 840). I also switched my FreeBSD laptop (again) to a EliteBook 1040 G1 (mainly to upgrade to a HiDPI display and an i7 to make compiling FreeBSD Ports faster).
UPDATE 4: I moved the update messages to the bottom.
Also, if you are interested on running FreeBSD on an EliteBook and use 12-CURRENT from January 31, 2018 onwards (or 12.0-RELEASE onwards when it comes out), you get Synaptics support. The SVN commits are as follows:
- psm: Add a kludge to support 0x46 identity middle byte Synaptics touchpads
- psm(4): Add support for HP EliteBook 1040 ForcePads. (This may also support the 1040 G2 and 1020 G1)
I will still keep this article up because there may be other laptops where Synaptics (or Elantech) may not be detected properly.
UPDATE 5: Two things:
- Fix a typo in Update 4.
- Good news: The patches for the Synaptics on HP EliteBooks have been backported to 11-STABLE and will make it to 11.2.