The company I work for gave to me a Lenovo ThinkPad SL500 notebook in which I’ve installed Ubuntu Intrepid (8.10).
Almost all has gone at the first shot but I discovered that the SL series is not a “real” ThinkPad and the thinkpad_acpi module doesn’t work at all with sl series laptops.
Volume Up, Volume Down and Mute buttons did not work and brightness was a mess: on power saving the brightness increased, pressing the brightness Up button (Fn+Home) decreased and pressing the brightness down button (Fn+End) increased.
Googleing at firs led nothing until…. I found an experimental module developed by Alexandre Rostovtsev (tetronimo).
Here a step by step guide to let Lenovo SL Series laptop hotkeys start working.
Edit: Karmic comes with tetronimo module but it does not load it…. Simply go and edit the /etc/modules file and add the lenovo-sl-laptop at the end of the list. Automagically all buttons will work again.
First, download from here the tarball of the kernel module made by Alexandre Rostovtsev.
Extract it into a directory, build the module and copy it to the modules directory:
tar zxvf tetromino-lenovo-sl-laptop-b19a08f81f693581013d7badfed6fd82e18a9a72.tar.gz cd tetromino-lenovo-sl-laptop-b19a08f81f693581013d7badfed6fd82e18a9a72 make all sudo cp lenovo-sl-laptop.ko /lib/modules/`uname -r`/kernel/drivers/misc
The tarball name and the directory name could be different from the one I wrote on this guide.
Rebuild modules dependencies:
Blacklist thinkpad_acpi module, as it simply doesn’t load.
To do that, edit the /etc/modprobe.d/blacklist file:
sudo gedit /etc/modprobe.d/blacklist &
and add the following line to the end of file
save and close.
Edit /etc/init.d/hotkey-setup by adding the following lines after the:
LENOVO*) case "$version" in
at line 147 and before the line
*Think[Pp]ad*SL*) . /usr/share/hotkey-setup/lenovo.hk echo 0 > /sys/module/video/parameters/brightness_switch_enabled modprobe lenovo-sl-laptop ;;
After you modified the file it should became as follows:
LENOVO*) case "$version" in *Think[Pp]ad*SL*) . /usr/share/hotkey-setup/lenovo.hk echo 0 > /sys/module/video/parameters/brightness_switch_enabled modprobe lenovo-sl-laptop ;; *Think[Pp]ad*) do_thinkpad --no-brightness ;; *) . /usr/share/hotkey-setup/lenovo.hk ;; esac
save and close.
Canonical has released Ubuntu 9.04 and hotkey-setup is completely different from the 8.10 version. If you upgraded to Ubuntu 9.04 the hotkey-setup file coming from 9.04 has to be “patched” as follows, adding the two bold lines after the do_video call:
do_video echo 0 > /sys/module/video/parameters/brightness_switch_enabled modprobe lenovo-sl-laptop
Now let’s set some options for the module.
Create the file /etc/modprobe.d/lenovo-sl-laptop.conf
sudo gedit /etc/modprobe.d/lenovo-sl-laptop.conf
and paste into it the following line
options lenovo-sl-laptop control_backlight=1
Now we have to restart the modules:
sudo /etc/init.d/hotkey-setup stop sudo /etc/init.d/hotkey-setup start
and you will be able to use (almost) all the special keys of your laptop.
Edit: For all of you that upgraded to 9.04 and experience warning about lenovo-sl-laptop.modprobe file, simply rename it to lenovo-sl-laptop.conf. I edited the guide to ensure the correct naming convention.If you still experience strange behaviours with the brightness control, blacklist video module, comment the line in the script with the echo 0 >/sys/module/video/parameters/brightness_switch_enabled and restart.
The only special key that won’t work will be Fn+F8. If you want also use the Fn+F8 (ultranav) key you have to hack a little bit more:
First we have to enable shared memory for synaptic touchpad.
Create the file /etc/hal/fdi/policy/shmconfig.fdi
sudo gedit /etc/hal/fdi/policy/shmconfig.fdi
and paste into it the following lines:
<?xml version="1.0" encoding="ISO-8859-1"?> <deviceinfo version="0.2"> <device> <match key="input.x11_driver" string="synaptics"> <merge key="input.x11_options.SHMConfig" type="string">True</merge> </match> </device> </deviceinfo>
save and close.
Ubuntu doesn’t installs, by default, the very useful tool notify-send. Install it with apt-get:
sudo apt-get install libnotify-bin
Now we must create a script to be launched when we press the Fn+F8 key. This script will simply toggle the touchpad status.
let’s make a directory to store the script:
sudo mkdir /usr/share/hotkey-setup/gconf-commands
Now let’s create the file /usr/share/hotkey-setup/gconf-commands/synaptic-touchpad-toggle
sudo gedit /usr/share/hotkey-setup/gconf-commands/synaptic-touchpad-toggle
copy and paste the following lines into the file:
#!/bin/bash STATE=`synclient -l | grep TouchpadOff | cut -f2 -d'=' | cut -c2` PARAMS="-t 1500 -i /usr/share/pixmaps/gnome-user-interface.png" if [ $STATE -eq 0 ] ; then synclient TouchpadOff=1 notify-send $PARAMS "Touchpad <i>DISABLED</i>" "Touchpad has been <b><i>DISABLED</i></b>" else synclient TouchpadOff=0 notify-send $PARAMS "Touchpad <i>ENABLED</i>" "Touchpad has been <b><i>ENABLED</i></b>" fi
save and close
now let the file executable:
sudo chmod uga+x /usr/share/hotkey-setup/gconf-commands/synaptic-touchpad-toggle
The lenovo-sl-module echoes the keycode 148 (or the X equivalent XF86Launch1) when we press Fn+F8.
To let gnome launch the script we just created we have to add a copule of keys in gconf:
gconftool-2 -s --type string /apps/metacity/keybinding_commands/command_1 /usr/share/hotkey-setup/gconf-commands/synaptic-touchpad-toggle gconftool-2 -s --type string /apps/metacity/global_keybindings/run_command_1 XF86Launch1
Edit: Jaunty Jackalope added a new feature in the keyboard shortcuts thal let every user to define a custom action. The previous gconf hack doesn’t work anymore and must be changed as follows (the first two lines simply reset the previous hack):
gconftool-2 -s --type string /apps/metacity/keybinding_commands/command_1 disabled gconftool-2 -s --type string /apps/metacity/global_keybindings/run_command_1 disabled gconftool-2 -s --type string /desktop/gnome/keybindings/custom0/name "Touchpad Toggle" gconftool-2 -s --type string /desktop/gnome/keybindings/custom0/action /usr/share/hotkey-setup/gconf-commands/synaptic-touchpad-toggle gconftool-2 -s --type string /desktop/gnome/keybindings/custom0/binding XF86Launch1
Now by pressing the Fn+F8 the touchpad will toggle from Enabled to Disabled with a notification message.
I hope this guide will help you. I also hope Alexandre module will be added to the kernel as soon as possible.
That’s all folks!