Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Fn+R refresh rate toggle #67

Open
st0nie opened this issue Jun 14, 2023 · 7 comments · Fixed by #69
Open

Support Fn+R refresh rate toggle #67

st0nie opened this issue Jun 14, 2023 · 7 comments · Fixed by #69

Comments

@st0nie
Copy link
Collaborator

st0nie commented Jun 14, 2023

now I use a script to toggle refresh rate

https://github.com/st0nie/refreshd

and acpid event file

event=1E3391A1-2C89- 000000e8 00000000
action=sudo -u ston HOME=/home/ston/ DIPLAY=":1" XDG_RUNTIME_DIR=/run/user/1000 QT_QPA_PLATFORM=wayland /home/ston/.local/bin/refreshed toggle

But there is a problem with this. any fn+letter key combination triggers this toggle. Is there a way to only use fn+q?

@MrDuartePT
Copy link
Collaborator

I also have the same issue I also create a script for more DE
https://github.com/MrDuartePT/hyprland-dotfiles/blob/master/refresh-rate-fn-r.sh

@MrDuartePT
Copy link
Collaborator

MrDuartePT commented Jun 17, 2023

dmesg output when pressing the key:

[Sat Jun 17 00:33:25 2023] legion_laptop: Event: legion type: 1;  acpi type: 1 (1=integer)
[Sat Jun 17 00:33:26 2023] legion_laptop: Event: legion type: 1;  acpi type: 1 (1=integer)
[Sat Jun 17 00:33:27 2023] legion_laptop: Event: legion type: 4;  acpi type: 1 (1=integer)
[Sat Jun 17 00:33:27 2023] legion_laptop: Event: legion type: 4;  acpi type: 1 (1=integer)
[Sat Jun 17 00:33:41 2023] legion_laptop: Event: legion type: 1;  acpi type: 1 (1=integer)
[Sat Jun 17 00:33:41 2023] legion_laptop: Event: legion type: 1;  acpi type: 1 (1=integer)
[Sat Jun 17 00:33:49 2023] legion_laptop: Event: legion type: 1;  acpi type: 1 (1=integer)
[Sat Jun 17 00:33:50 2023] legion_laptop: Event: legion type: 1;  acpi type: 1 (1=integer)
[Sat Jun 17 00:33:51 2023] legion_laptop: Event: legion type: 1;  acpi type: 1 (1=integer)
[Sat Jun 17 00:33:51 2023] legion_laptop: Event: legion type: 1;  acpi type: 1 (1=integer)
[Sat Jun 17 00:35:02 2023] legion_laptop: Event: legion type: 1;  acpi type: 1 (1=integer)
[Sat Jun 17 00:35:05 2023] legion_laptop: Event: legion type: 1;  acpi type: 1 (1=integer)
[Sat Jun 17 00:35:05 2023] legion_laptop: Event: legion type: 1;  acpi type: 1 (1=integer)
[Sat Jun 17 00:35:06 2023] legion_laptop: Event: legion type: 1;  acpi type: 1 (1=integer)
[Sat Jun 17 00:35:06 2023] legion_laptop: Event: legion type: 1;  acpi type: 1 (1=integer)
[Sat Jun 17 00:35:07 2023] legion_laptop: Event: legion type: 1;  acpi type: 1 (1=integer)
[Sat Jun 17 00:35:15 2023] legion_laptop: Event: legion type: 1;  acpi type: 1 (1=integer)
[Sat Jun 17 00:35:15 2023] legion_laptop: Event: legion type: 1;  acpi type: 1 (1=integer)
[Sat Jun 17 00:35:16 2023] legion_laptop: Event: legion type: 1;  acpi type: 1 (1=integer)
[Sat Jun 17 00:36:23 2023] legion_laptop: Event: legion type: 1;  acpi type: 1 (1=integer)
[Sat Jun 17 00:36:29 2023] legion_laptop: Event: legion type: 1;  acpi type: 1 (1=integer)
[Sat Jun 17 00:36:31 2023] legion_laptop: Event: legion type: 1;  acpi type: 1 (1=integer)

acpi_listen:

 1E3391A1-2C89- 000000e8 00000000
 8FC0DE0C-B4E4- 000000d0 00000000
 1E3391A1-2C89- 000000e8 00000000
 8FC0DE0C-B4E4- 000000d0 00000000
 1E3391A1-2C89- 000000e8 00000000
 8FC0DE0C-B4E4- 000000d0 00000000
 1E3391A1-2C89- 000000e8 00000000
 8FC0DE0C-B4E4- 000000d0 00000000
 1E3391A1-2C89- 000000e8 00000000
 8FC0DE0C-B4E4- 000000d0 00000000
 1E3391A1-2C89- 000000e8 00000000
 8FC0DE0C-B4E4- 000000d0 00000000
 1E3391A1-2C89- 000000e8 00000000
 8FC0DE0C-B4E4- 000000d0 00000000
 1E3391A1-2C89- 000000e8 00000000
 8FC0DE0C-B4E4- 000000d0 00000000
 1E3391A1-2C89- 000000e8 00000000
 8FC0DE0C-B4E4- 000000d0 00000000
 1E3391A1-2C89- 000000e8 00000000

Also evtest dosent detect keypress:

Not running as root, no devices may be available.
Available devices:
/dev/input/event0:	Power Button
/dev/input/event1:	Lid Switch
/dev/input/event10:	HD-Audio Generic Mic
/dev/input/event11:	Razer Razer Basilisk
/dev/input/event12:	Razer Razer Basilisk
/dev/input/event14:	Ideapad extra buttons
/dev/input/event15:	PC Speaker
/dev/input/event16:	HDA NVidia HDMI/DP,pcm=3
/dev/input/event17:	HDA NVidia HDMI/DP,pcm=7
/dev/input/event18:	HDA NVidia HDMI/DP,pcm=8
/dev/input/event19:	HDA NVidia HDMI/DP,pcm=9
/dev/input/event2:	Power Button
/dev/input/event20:	HD-Audio Generic Headphone
/dev/input/event21:	Razer Razer Basilisk
/dev/input/event3:	AT Raw Set 2 keyboard
/dev/input/event4:	Video Bus
/dev/input/event5:	Video Bus
/dev/input/event6:	ITE Tech. Inc. ITE Device(8910) Keyboard
/dev/input/event7:	MSFT0001:00 04F3:31DD Mouse
/dev/input/event8:	ITE Tech. Inc. ITE Device(8910) Wireless Radio Control
/dev/input/event9:	MSFT0001:00 04F3:31DD Touchpad
Select the device event number [0-21]: 14
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x0 product 0x0 version 0x0
Input device name: "Ideapad extra buttons"
Supported events:
 Event type 0 (EV_SYN)
 Event type 1 (EV_KEY)
   Event code 1 (KEY_ESC)
   Event code 138 (KEY_HELP)
   Event code 148 (KEY_PROG1)
   Event code 149 (KEY_PROG2)
   Event code 186 (KEY_F16)
   Event code 190 (KEY_F20)
   Event code 192 (KEY_F22)
   Event code 193 (KEY_F23)
   Event code 202 (KEY_PROG3)
   Event code 203 (KEY_PROG4)
   Event code 212 (KEY_CAMERA)
   Event code 227 (KEY_SWITCHVIDEOMODE)
   Event code 240 (KEY_UNKNOWN)
   Event code 247 (KEY_RFKILL)
   Event code 364 (KEY_FAVORITES)
   Event code 431 (KEY_DISPLAYTOGGLE)
 Event type 4 (EV_MSC)
   Event code 4 (MSC_SCAN)
Properties:
Testing ... (interrupt to exit)

@MrDuartePT MrDuartePT linked a pull request Jun 17, 2023 that will close this issue
@MrDuartePT
Copy link
Collaborator

MrDuartePT commented Jun 21, 2023

@st0nie you can discuss your ideias here.
The special function keys will be introduce later.

@MrDuartePT MrDuartePT reopened this Jun 21, 2023
@st0nie st0nie changed the title Support fn+r refresh rate toggle Support Fn+R refresh rate toggle Jun 29, 2023
@darthf1
Copy link

darthf1 commented May 16, 2024

Am I correct that this will be resolved with the linux kernel 6.9? It mentions IdeaPad specifically, but?

https://www.omgubuntu.co.uk/2024/05/linux-kernel-6-9-features

There’s also support for the Lenovo IdeaPad ‘refresh rate’ key (which you’ll be shocked to hear us used to change display refresh rate); fan speed control for Microsoft Surface laptops, and the Lenovo ThinkPad ACPI driver now works with more Fn keys.

@MrDuartePT
Copy link
Collaborator

MrDuartePT commented May 16, 2024

Am I correct that this will be resolved with the linux kernel 6.9? It mentions IdeaPad specifically, but?

https://www.omgubuntu.co.uk/2024/05/linux-kernel-6-9-features

There’s also support for the Lenovo IdeaPad ‘refresh rate’ key (which you’ll be shocked to hear us used to change display refresh rate); fan speed control for Microsoft Surface laptops, and the Lenovo ThinkPad ACPI driver now works with more Fn keys.

Well I have kernel 6.9 install, I could test it. But if dosen't work I also planning on creating a patch to add fn+star (legion star symbol) and fn+PrtSC buttons

@st0nie well when I have time I can try to add Refresh Rate control to legiond

@MrDuartePT
Copy link
Collaborator

@st0nie @darthf1 dosent work on my model, the key is not recognised:

Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x0 product 0x0 version 0x0
Input device name: "Ideapad extra buttons"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 1 (KEY_ESC)
    Event code 138 (KEY_HELP)
    Event code 148 (KEY_PROG1)
    Event code 149 (KEY_PROG2)
    Event code 186 (KEY_F16)
    Event code 190 (KEY_F20)
    Event code 192 (KEY_F22)
    Event code 193 (KEY_F23)
    Event code 202 (KEY_PROG3)
    Event code 203 (KEY_PROG4)
    Event code 212 (KEY_CAMERA)
    Event code 227 (KEY_SWITCHVIDEOMODE)
    Event code 240 (KEY_UNKNOWN)
    Event code 247 (KEY_RFKILL)
    Event code 364 (KEY_FAVORITES)
    Event code 445 (?)
    Event code 446 (?)
    Event code 562 (?)
    Event code 634 (?)
  Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)

@darthf1
Copy link

darthf1 commented May 17, 2024

@st0nie @darthf1 dosent work on my model, the key is not recognised:

Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x0 product 0x0 version 0x0
Input device name: "Ideapad extra buttons"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 1 (KEY_ESC)
    Event code 138 (KEY_HELP)
    Event code 148 (KEY_PROG1)
    Event code 149 (KEY_PROG2)
    Event code 186 (KEY_F16)
    Event code 190 (KEY_F20)
    Event code 192 (KEY_F22)
    Event code 193 (KEY_F23)
    Event code 202 (KEY_PROG3)
    Event code 203 (KEY_PROG4)
    Event code 212 (KEY_CAMERA)
    Event code 227 (KEY_SWITCHVIDEOMODE)
    Event code 240 (KEY_UNKNOWN)
    Event code 247 (KEY_RFKILL)
    Event code 364 (KEY_FAVORITES)
    Event code 445 (?)
    Event code 446 (?)
    Event code 562 (?)
    Event code 634 (?)
  Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)

Too bad, thanks for checking!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants