|I recently purchased a new (refurbished) HP “Elitebook” 8440p laptop (see previous blog post) and docking station, and installed my custom “remastered” copy of Antix Linux! Before buying, I had tried out my remastered Antix live-DVD on my wife’s laptop (same model with lower resolution screen) and everything basic seemed to check out. As I expected, this laptop has proved to be a great laptop for Linux but I’ve been somewhat surprised at the number of additional (and difficult) issues/hacks I’ve had to resolve/make to my (already very customized) remastered linux installation. In my previous post I described the nightmare I went through getting Linux to boot with Windows 7, though this is not at all a fault of the computer or it’s hardware, but rather owing to the way Windows 7 was partitioned and installed. Another hack / workaround I ended up having to make (after another extended, but fruitless search) was downgrading my “AccelMethod” from “SNA” back to “UXA” in my /etc/11/xorg.conf file to stop screen corruption and lockup when exiting X without having to add a “chvt 1; sleep 2” sequence to each logout/exit/reboot command script in the window-manager, and disabling the “Ctrl-Alt-Backspace” command. Switching to “UXA” eliminated the need for these workarounds (after I tried everything else I could come up with). This machine has a LATER version of Intel graphics (Mesa DRI Intel Ironlake Mobile x86/MMX/SSE2). The tradeoff is a slight reduction in video performance from up to 2000 fps to around 1700 or so, only really noticeable by running glxgears (My Dell never broke above 900 fps, but WORKED flawlessly with SNA!).|
|The hardware was very similar (driver-wise) to that of my old Dell D620, but more modern (Intel CPU, Intel integrated graphics, sound, and network interfaces). The first issue that needed tweaking was to activate all the custom special-function keys. Nearly all laptops have them and they all seem to be different not only between brands, but also between models. I had long ago gotten the Dell’s all working using a now rather old program called “hotkeys”, however, I had not used them in ages since my Dell has not had a working battery since forever, and I’ve been using it almost exclusively docked (and the lid closed). I’ve found that hotkeys seems to not work well anymore due to trouble staying up between suspends, etc. I began looking for a better solution and found “xbindkeys”. This program also includes a GUI which permits you to actually press each key and then add your desired action command and builds the config. file for you! This strategy proved successful for all the special keys, including the little “led” light-up ones above the keyboard that look more like status indicators than press-able keys. The only ones not configurable via xbindkeys were the “wifi switch” led/key and the “touchpad toggle” led/key.
|The wifi key “works” in that it uses rfkill to toggle the wifi. For most people, this will probably work fine out of the box, but I configure my networks manually, and need for the wifi to go off (and ethernet to come on) when docking so that my home network comes up on the ethernet connection (I needed to be able to execute a custom script whenever this key was pressed). I ended up getting this key working by adding an ACPI event and script (see below).|
|I got all the special HP light-up buttons above the keyboard working with xbindkeys EXCEPT the one that looks like a tiny touchpad, that’s supposed to toggle the touchpad. That little bugger just did not want to work, not even in Windows-7?! The “touchpad toggle” led/key lights up cyan on startup and the touchpad is enabled. Pressing it turns it orange and (should) disable the touchpad. Touching again turns it back to cyan (should re-enable touchpad). In reality, it does nothing but change color when pressed. X does not see it except the very first time it’s pressed, in which case xev sees a continuous spewing of keypresses and releases of keycode 138 killable by pressing Ctrl-C. dmesg reveals that the kernel sees the alternate press as unassigned scancode “e058”. Subsequent presses produce nothing visible to X until you reboot. I tried adding the setkeycodes command the kernel suggested, googled and googled and could not find anything that would make this key visible to X. The console program showkey would show it alternately returning keycode 138 and keycode 140 (the one I assigned with setkeycodes) as I wanted, but for some reason nothing in X could see anything when the key was pressed. Obviously, the key was seen by the kernel. Several google pages described how to “translate” these kernel keycodes to X, including xmodmap, but nothing worked.|
|It was not like this particular key was very important to me, but at this point it had just become a determined challenge to force it to work! I finally stumbled upon a tiny C program that could monitor the keyboard input device and report each key pressed. I ended up modifying this program to look for these two keycodes and calling a command whenever one was seen. I then set this program up as a tiny daemon so that I can now press the key and toggle the state of the touchpad! Why? Because I could and because I had already wasted too much time trying to figure this out! 😀|
|I finally found, stole and hacked up a tiny daemon C program that DOES make it work! You need to do the following:|
|1) in rc.local or somewhere in startup scripts add: /usr/bin/setkeycodes e058 140
2) compile this little C program “keycheckd” (gcc -o keycheckd keycheckd.c) and place the compiled binary in /usr/local/bin/, and chown 4755 keycheckd
3) In your X desktop session’s startup script do (must be started from w/n X desktop, NOT startup or console!):
|The source (keycheckd.c) (note: you could add other keysyms / actions, if needed):
|Now, when you press this “key”, it should turn orange and actually disable your touchpad, a second press should turn it back blue and re-enable your touchpad. I believe you could add the “/usr/bin/synclient TouchpadOff=1” in your X session startup script above where you start this daemon, and reverse the two “TouchpadOff=#” commands in it to have it start out disabled, then toggle to enabled, then disabled, etc.|
View My Photography
May 2016 S M T W T F S « Apr 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
- I want to be your swell internet blogger who does all the really neat stuff you want a swell internet blogger to do. In fact this is probably the most swollen blog you’ll find!