cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
damipablo
Blue Screen Again
Posts: 2
Registered: ‎12-18-2017
Location: AR
Views: 1,523
Message 1 of 8

How can I disable Hotkey on a Lenovo Yoga 920 in linux?

Hello.

                    I'm running linux on my new lenovo 920, I'm very much used to old working mode of Function Keys and would like to swap the hotkey mode to old fashioned mode.

 

                    I've tried from bios, as sugested in lenovo's forum but the option is not available on mine.

 

                    Any way I can achive this?

 

Best regards.

Damian

okeri
Blue Screen Again
Posts: 10
Registered: ‎12-09-2017
Location: RU
Views: 1,220
Message 2 of 8

Re: How can I disable Hotkey on a Lenovo Yoga 920 in linux?

Hello, first for all: congratulation with buying a great laptop. With linux onboard it became awesome

I've spent insane amount of time while googling to find a solution with no luck.

But thanks to lenovo engineers it's not very hard to dig in acpi dsdt tables. So i made a fast solution you can find at https://github.com/okeri/ideapad-hacks

No need to override dsdt, just compile kernel module and access to FN-lock via sysfs. Once you change this setting, you can unload module. It works for my yoga 920 and it seems it should work for other Lenovo Yoga's starting from 700 (Lenovo Yoga 910 at least).

 

damipablo
Blue Screen Again
Posts: 2
Registered: ‎12-18-2017
Location: AR
Views: 1,217
Message 3 of 8

Re: How can I disable Hotkey on a Lenovo Yoga 920 in linux?

Hello.

             I've just tried your code on my 920 with Ubuntu 16.04 and it works!!!!

 

            Excelent Job.

 

 

 

Thank you very much

Damian

Highlighted
s0l4r
Fanfold Paper
Posts: 2
Registered: ‎04-28-2018
Location: SE
Views: 1,140
Message 4 of 8

Re: How can I disable Hotkey on a Lenovo Yoga 920 in linux?

This is brilliant!

 

I will try it if i wipe Windows and replace it with Linux.

 

I wish Lenovo could make life easier for its customers by including the function to switch the behavior in the BIOS though...

 

kolleK
What's DOS?
Posts: 3
Registered: ‎06-30-2018
Location: DK
Views: 985
Message 5 of 8

Re: How can I disable Hotkey on a Lenovo Yoga 920 in linux?

This is indeed a great hack.

 

Thank you very much.

 

I'll autommate it in a script eecuted while booting.

 

|<

kolleK
What's DOS?
Posts: 3
Registered: ‎06-30-2018
Location: DK
Views: 972
Message 6 of 8

Re: How can I disable Hotkey on a Lenovo Yoga 920 in linux?

Here's what I did to automate the process:

 

Create a script with this content (I know it contains a lot, but thats for my memory)

 

#!/bin/bash
#
# This script will
# remove the ideapad_laptop kernel module
# add the ideapad-hack module
# correct the F-keys, so the F-keys after will work as expected
# This means that you'll have to use Fn+Fkey in order to dim light or other Fn functionality
#
# Get the ideapad-hack module sourceby issuing these commands:
#
# git clone https://github.com/okeri/ideapad-hacks.git
# cd ideapad-hacks/
#
# dnf install kernel-headers  elfutils-libelf-devel
#
# make
#
# Now the hack module is in place you can after boot execute                                                                                            
                                                                                                                                                     
rmmod ideapad_laptop                                                                                                                                 
# due to incompability                                                                                                                               
                                                                                                                                                     
insmod /root/ideapad-hacks/ideapad-hacks.ko                                                                                                          
# new module inserted                                                                                                                                
                                                                                                                                                     
echo 0 > `find /sys -name "fn_lock"`                                                                                                                 
# and you functionkeys should work as expected again                                                                                                 
# Happy Hacking         

 

Next thing is to try this script after a fresh boot. If it works as expected then create a file in /etc/systemd/system

 

I called mine functionkeys.service and I put this into it:

 

[Unit]                                                                                                                                               
Description=functionkeys                                                                                                                             
                                                                                                                                                     
[Service]                                                                                                                                            
ExecStart=/root/bin/getFunctionKeysRight.sh                                                                                                          

[Install]
WantedBy=multi-user.target

 

Finaly enable the script

 

]$ systemctl enable functiokey.service

 

and start it

 

]$ systemctl start functionkeys.service

 

Reboot an test

okeri
Blue Screen Again
Posts: 10
Registered: ‎12-09-2017
Location: RU
Views: 937
Message 7 of 8

Re: How can I disable Hotkey on a Lenovo Yoga 920 in linux?

Hello kolleK, nice job. Anyway i let myself to make some comments:

1. You should not place rmmod into systemd service files. Instead of that simply blacklist unwanted module. (man modprobe.d is highly recommanded). Same for inserting kernel modules at linux boot.

2. ideapad-hacks makes acpi call into laptop's embedded controller, so if you don't need to toggle fn-lock at runtime, you do not need to keep ideapad-hacks permanently loaded . It's enough to load it and set 0 to fn_lock only once. Internal embedded controller will keep this value, until it will not be changed in windows(if present). Battery unplug (probably Reset BIOS to defaults as well) also will reset this value.

kolleK
What's DOS?
Posts: 3
Registered: ‎06-30-2018
Location: DK
Views: 925
Message 8 of 8

Re: How can I disable Hotkey on a Lenovo Yoga 920 in linux?

Okei, thaks for your comments. It was a quick hack, that sovled one of my issues with the 920. But I need to redo it one day. I'm running Fedora and we keep getting new kernels all the time, so I need to do some more checking and possibly rebuilding of the module.
|<

Check out current deals!


Shop current deals

Top Kudoed Authors