Lenovo ThinkPad SL Series hotkeys (brightness, volume and ultranav)Karmic

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:

sudo depmod

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

blacklist thinkpad-acpi

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*)
*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.

Edit:

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!

56 risposte a “Lenovo ThinkPad SL Series hotkeys (brightness, volume and ultranav)Karmic

  1. salve,
    volevo ringraziarti per l’ottimo tutorial, il thinkpad sl500 è chiaramente più luminoso e finalmente i controlli funzionano correttamente. quasi non posso credere che funzionino anche i tasti del volume.
    ho installato ubuntu 8.10 appena ho ricevuto questo laptop perchè non sopportavo di usare ms vista che trovo pessimo e ridondante. fino a quel punto usavo xp pro su un vecchio thinkpad g40 e un piccolo eeepc con linux xandros. E’ LA PRIMA VOLTA CHE METTO LE MANI NEL KERNEL!!! Ti sembrerà un’idiozia ma per me è una conquista, anche perchè faccio un mestiere che ha ben poco a che fare con l’informatica. Avevo installato una redhat diversi anni fa su un vecchio ibm da ufficio, ma poi avevo dovuto desistere per mancanza di tempo e di conoscenze. Mi pare che ubuntu metta finalmente linux a disposizione di un pubblico più vasto. Ora provo a far funzionare anche Fn+F8.
    Ti segnalo che c’è un errore di sintassi nel riquadro sulle linee da aggiungere al file /etc/init.d/hotkey-setup. Io le avevo copiate e incollate e quando ho provato a far ripartire il modulo ho ricevuto un messaggio di errore. Fortunatamente avevi aggiunto subito dopo la sintassi corretta. Vanno aggiunti due asterischi nella prima linea ( 148 )

    *Think[Pp]ad*SL*)
    anzichè
    Think[Pp]ad SL*)

    Infine ti chiedo, se ne hai il tempo, di darmi un consiglio: vorrei eliminare del tutto Vista o perlomeno ridurne la partizione che si becca più di 90 Gb, ma temo di fare casino con le partizioni di vista e quelle di servizio della lenovo. Se hai qualche dritta te ne sarò grato.
    Grazie comunque

    • Grazie per la segnalazione del refuso e per i complimenti (in gran parte immeritati, visto che il grosso lo sta facendo Alexandre).
      In effetti ieri mattina ho anche io sperimentato l’errore e ho corretto il post.
      Per quanto riguarda le partizioni. Sul mio portatile ho ancora la partizione con windows xp ma l’ho abbondantemente ridotta (gparted va benissimo), visto che spero di non usarla più (ma mai dire mai).
      Per quanto riguarda la partizione di recovery, GRUB (il boot manager di UBUNTU) la vede come una installazione di Windows NT. Ti consiglio di non toccarla, almeno per il momento, (sempre per quanto detto sopra 🙂 ).
      Essendo su una partizione separata abbastanza piccola (circa 4GB la mia), non dovresti avere problemi a riconoscerla quando userai gparted.

  2. It’s work on my SL 300.
    Grazie mille!!! 😀

  3. Thank you very much! This solve my problem. If I may suggest something, you wrote

    “No we have to restart the modules

    sudo /etc/init.d/hotkey_setup stop
    sudo /etc/init.d/hotkey_setup start”

    It’s actually better with

    sudo /etc/init.d/hotkey-setup stop
    sudo /etc/init.d/hotkey-setup start

    But once again, thank you!

  4. Hello!

    Unfortunately this is not working on Ubuntu 9.04 because there is no “/usr/share/hotkey-setup/lenovo.hk”.
    Could you help me how to fix it?

    Thanks.

  5. Guida eccelsa 🙂 !

    Ora pero’ ci vuole la versione per Ubuntu 9.04 😉 !

  6. Does the module work with Ubuntu 9.04?

    I upgraded to Jaunty and am stuck at the bit where you edit the /etc/init.d/hotkey-setup file. It now does not have the lines you describe to edit after: http://pastebin.com/f713ebcfa

  7. To have hotkey-seup working agaion in 9.04 simply use the hotkey-setup coming from distro and add the following lines after the do_video call:
    echo 0 > /sys/module/video/parameters/brightness_switch_enabled
    modprobe lenovo-sl-laptop

  8. thanks a lot!!
    volume and brightness keys now working on my SL500 – ubuntu 9.04 !! 😀

    Just a note: even if the brightness changes, the correspondent applet bar does not move… anyway not so important 😉

    • @Valerio: I’m using compiz and both the notification balloon (very attractive in 9.04) and the brightness applet change in accordion with key-press and brightness.

  9. Thank you so much, my Fn+brightup & brightdown now work (as a side note to any SL300 owners out there who find this in the future, this fix definitely allows the backlight (extra bright) that initially work to come on just fine.

    So my question is, is there a way to make Ubuntu start defaulted to the highest brightness? I have to do Fn+Increase a few times every time on startup as it stands now.

  10. bravo!
    Adding
    echo 0 > /sys/module/video/parameters/brightness_switch_enabled
    modprobe lenovo-sl-laptop
    under the do_video call fixed my sl500 after upgrading to jaunty.

  11. thanks, that works out.

    i was searching for this solution for hours. Tanks
    only decreasing volume wont work.
    can you please help. or give an advise.

  12. Hello Gianluca,

    Thanks for this nice big HowTo, I can use my SL300 now much more conveniently under Ubuntu 9.04 !

    All the special keys work now, except for that Touchpad toggle (which you described in the very last part of your HowTo).
    Nothing happens if I press Fn+F8.
    This is puzzling to me since this feature was working with the Ubuntu 8.10 version until yesterday…
    Do you have any idea about that? Cheers and thanks again,

    Felix

    • @Felix: In 9.04 the keyboard shortcuts allow to define custom actions and the 8.10 hack doesn’t work anymore. I’ve edited the post. Check if it solves the issue.

  13. Does anyone of you is experimenting problems with noisy fan on the SL500?
    I try my luck here, considering this HowTo really solved all the problems related with screen brightness and hotkeys (thank you again, Gianluca!).
    I would not post a request in the comments of a blog, but perhaps some of you are experimenting the same problem and have some hint aout this.
    This started for me about one month ago, but i’ve been happily using this laptop from january and thinking it was really silent, especially when working in the night. Now i must reconsider the question ‘cause since one month the fan seems to work continuously and quite loudly, both on AC and on battery, and both in Ubuntu and in Vista. There is a really long thread about this problem on the Lenovo forum, but no solution. I upgraded to the 1.23 version of the bios, but it’s no use. I would look for some linux sw to control fan speed, but i don’t know which one and i’m afraid to damage the machine.
    Any suggestion? Thanks.
    Andrea

    • @Andrea: Actually my SL500 fan is working well. Did you try to get the last source from Alexandre? In one of the last deploy He added some “features” related to the fan. Maybe it solves your issue

      • Thank you Gianluca, but as I told you Alexandre module is already working on my sl500 – and this thank to your tutorial.
        My problem is that, after 2/3 minutes from powering on the laptop, the fan starts to snarl quite loudly. But the noise is not the only problem cause the vibration on the left side of the keyboard is clearly perceptible (not nice at all!). Googleing around and evaluating the situation of my laptop I think the problem is related with temperature sensors, cause the air that is flowing, for example now after two hours working, is tepid not to say COLD…
        I read that the debate on the opportunity to hack and control fan speed is quite controversial, and my knowledge is so limited that i’m afraid of using badly some scripts that i found and that mostly are related with previous vrsions of ubuntu (i’m still using 8.10, but one of these days upgradinh to jaunty).
        Anyway, thank you for the response and the work you did.
        ciao
        Andrea

  14. Grazie infinite

    • L’ho fatto principalmente per me e l’ho voluto condividere in quanto considero questo il modo migliore per diffondere l’utilizzo di software open source ed in particolare linux.

  15. Thank you, this walk through was very helpful. Some issues I had were:
    – The biggest problem I am currently having is the trackpoint buttons are also disabled when I disable the touchpad with the provided script (help on this would be appreciated)
    – The makefile gives errors if there is a space in the containing folder (silly simple issue took me hours to figure out)
    – The touchpad configurations are for gnome desktop, a Kde counterpart would be helpful. I was able to adjust KDE shortcuts to run the touchpad disabling script with Fn+F8
    – As suggested earlier, the shortcut adjustment of display brightness is disconnected from the screen adjustment in power menu.

    My system is Kubuntu 9.04 with kernel 2.6.28-12

  16. Thank you so very much!!

  17. hi, i got an error right from the beginning, can you tell me what i should do ?

    ace@ace-laptop ~/Desktop/SL500 Brightness $ make all
    make -C /lib/modules/2.6.28-11-generic/build M=/home/ace/Desktop/SL500 Brightness modules
    make[1]: Entering directory `/usr/src/linux-headers-2.6.28-11-generic’
    make[1]: *** No rule to make target `Brightness’. Stop.
    make[1]: Leaving directory `/usr/src/linux-headers-2.6.28-11-generic’
    make: *** [all] Error 2

  18. Grazie mille – Big Thanks !

    Worked exactly as per your descriptions. I only had to install kernel headers.

    $ sudo apt-get update
    $ sudo apt-get install linux-headers-$(uname -r)

  19. great page…

    any way to apply this for use in Debian 5?

    • I really don’t know. You can compile and install the module for sure and blacklist video module. This should give you minimal support on hotkeys having brigtness and volume work as expected.

  20. Thank you so much I waited a long time for this!

  21. Hi,

    Thanks so much for this howto, it has been very usefull for me, on ubuntu 9.04 work perfect.

  22. Very good tutorial!
    I’m interested too on make this module work on Debian 5?
    Any suggestion? Someone tried it?

    Thanks a lot! 🙂

  23. Pingback: Lenovo SL500 e Ubuntu « la pappa scodellata

  24. e’ grazie a persone come te se i principianti (come me) possono imparare, 1000 grazie!

    1 domanda: ho eseguito il tutorial escludendo la parte per Fn+F8, tutto ok, ma come posso (se posso) usare bottone e il led LenovoCare?
    salutoni

  25. Pingback: Dirk Deimeke (dirk) 's status on Friday, 03-Jul-09 12:12:25 UTC - Identi.ca

  26. Bravo Gianluca !! Ti ringrazio per la tua preziosa collaborazione al software libero !! Saluti dal’ Argentina !

  27. Hello Gianluca Magalotti,

    I am new to Ubuntu and I just bought an SL500 and my bt & hotkeys & brightness dont work.
    I read your tutorial, but like I said Im new to Linux so I’ve had trouble.
    Can you help me and give me guidance in doing this
    “Extract it into a directory, build the module and copy it to the modules directory:” ??

    Thank you so much,

    Javier

  28. THANK YOU! now volume and brightness work!

    but, while i was trying to fix the F8 touchpad toggle hotkey i got this message when i tried to create the /hotkey-setup/gconf-commands directory in /usr/share.

    mkdir: impossibile creare la directory “/usr/share/hotkey-setup/gconf-commands”: Nessun file o directory

    i also tried graphically but it looks like i just cannot do that.

  29. thankx very much. Just clean installed 9.04 on SL-300, found problem with increase-decrease brightness– your wonderful solution solved it 🙂

    wonderful job!!!

  30. hi,

    It worked for the first time on my SL-300 (ubuntu 9.04 clean install), however, when I started my computer next time, it does not work!!!

    When I tried to decrease or increase brightness using Fn+End or Home (i’ve danish keyboard so Fn button), nothing happens. Do I have to start that module every time to make by brightness key work? or ?

  31. worked again!!! For some reason the file ‘lenovo-sl-lapotp.ko’ was missing from the /lib/modules/`uname -r`/kernel/drivers/misc folder.

    however, can we copy that file to lib/modules/`uname -r`/volatile ?

  32. hello there. i am a little newbie to linux and i have same problem as you. you wrote “Extract it into a directory, build the module and copy it to the modules directory”. i am wondering how to do that? is there something to do with terminal or something?could you write how to do that step by step, like where to enter values,what exactly to push and type. i know this is annoying, but for all lenovo’s.. 🙂 than you.

    • In the guide the only part that was missing was the one to extract the content from the tarball. I’ve added such lines even if the tarball name as well as the directory name could be different from the one you downloaded.

  33. Hi there! Thanks a lot for the awesome solution!
    Do u have also Problem with the Fan? The Fan in my sl300 spinnt at full speed all the time. Is it possible to control it?
    Best regards

  34. I found a issue over here. When Ubuntu upgrades the kernel, it does not copy the file lenovo-sl-laptop.ko and hence the problem again starts. We just need to copy the file, rebuild module dependency, stop and start the module. that’s all.

  35. Ubuntu 9.10 solves the hotkey problem. I have a Lenovo Thinkpad SL300, and after a fresh install of 9.10 (not an upgrade) the hotkey problem has been resolved.

  36. With Ubuntu 9.10, the hotkey for the sound function ?!
    Because I have upgraded my Ubuntu 9.04 and the brightness function but not the sound.

  37. After upgrading to Karmic volume buttons and most of hotkeys are not working for me. While the volume problem is just annoying the biggest issue for me is I cannot disable the touchpad and use only the trackpoint.
    Bluetooth is not working too (I get the message: “Service search failed (L’host non è in funzione) Selezionare un altro visualizzatore e tentare di nuovo.”
    I’m quite desperate about this upgrade. Any idea/suggestion?

  38. hotkey-setup & blacklist are supposed to be empty?
    i would really appreciate if you would update the guide for ubuntu 9.10…since i had failed to get my fn keys working *weep* *weep*

  39. Hi many thanks for posting this. I have gone back to using Jaunty after bad times with karmic.

    During make i get this error….

    stephen@darthmaul:~/tetromino-lenovo-sl-laptop-b19a08f$ sudo make allmake -C /lib/modules/2.6.28-11-generic/build M= modules
    make[1]: Entering directory `/usr/src/linux-headers-2.6.28-11-generic’
    CHK include/linux/version.h
    CHK include/linux/utsrelease.h
    SYMLINK include/asm -> include/asm-x86
    make[2]: *** No rule to make target `kernel/bounds.c’, needed by `kernel/bounds.s’. Stop.
    make[1]: *** [prepare0] Error 2
    make[1]: Leaving directory `/usr/src/linux-headers-2.6.28-11-generic’
    make: *** [all] Error 2
    stephen@darthmaul:~/tetromino-lenovo-sl-laptop-b19a08f$

    Can anyone help? Thanks

  40. Brightness now works perfectly, thanks! Unfortunately, the volume buttons on the left side of the keyboard still don’t do anything. How might I fix this? I’ve got an SL500 running 9.10.

  41. did the module name change in lucid? lenovo-sl-laptop does not work in lucid with me so far 😦

Scrivi una risposta a Anon Cancella risposta