3

Is there a way to reprogram the lenovo think vantage button to open and run a shell bash program on ubuntu 14.04 lts?

I have tried system preferences > keyboard >shortcuts > custom

and assigned a short cut to that button and it still doesn’t work

Thanks

2 Answers 2

1

xbindkeys should be able to do this. Install it with:

sudo apt-get install xbindkeys  

Now run:

xbindkeys -k  

and press the think vantage button. Your output should look something like:

Press combination of keys or/and click under the window.
You can use one of the two lines after "NoCommand"
in $HOME/.xbindkeysrc to bind a key.
"NoCommand"
    m:0x0 + c:159
    NoSymbol  

Now create a file named .xbindkeysrc in your home directory:

touch ~/.xindkeysrc  

open the file in your favourite editor and add:

"bash /path/to/your/script.sh"
m:0x0 + c:159  

Replacing m:0x0 + c:159 with whatever you got from your output earlier.

If you want a terminal window to open replace the first line with:

"gnome-terminal -e './path/to/script.sh"

Log out/back in or reboot for the changes to take effect.

(re)sources: ThinkWiki: ThinkPad Button

17
  • It dos not work it will not let me run it at 'xbindkeys-k'
    – Jhondoe
    Dec 15, 2014 at 16:40
  • @Jhondoe Can you be more specific? What happens exactly?
    – Seth
    Dec 15, 2014 at 17:03
  • I found away around that problem and have folwed the rest of your instructions but it still doesn't work
    – Jhondoe
    Dec 15, 2014 at 17:05
  • @Jhondoe Doesn't work isn't specific enough. Please upload your xbindkeysrc to paste.ubuntu.com and link it here so I can see. Thanks!
    – Seth
    Dec 15, 2014 at 17:09
  • The file is empty apart from what you said to upload
    – Jhondoe
    Dec 15, 2014 at 17:11
0

Possibly something has changed for the better on Xubuntu 18 Xfce 4.12.

I was able to assign a script to the ThinkVantage-button on a T420 from the built-in Keyboard control panel. Did not install any additional software.

Screenshot here of the Keyboard settings for Thinkpad button

The ThinkVantage button has shortcut "XF86Launch1" - it was ridiculously simple. Now I can toggle touchpad on/off with the Thinkpad button. Sweet.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.