hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
21.48k stars 898 forks source link

Scroll Lock Key Not Functioning with RGB Keyboard on Hyprland (Arch Linux) #7961

Closed sharjeelmazhar closed 4 weeks ago

sharjeelmazhar commented 1 month ago

Already reported ? *

Regression?

No

System Info and Version

Hyprland, built from branch at commit 0f594732b063a90d44df8c5d402d658f27471dfe (props: bump version to 0.43.0). Date: Sun Sep 8 16:48:21 2024 Tag: v0.43.0, commits: 5196

flags: (if any)

System Information: System name: Linux Node name: arch Release: 6.6.52-1-lts Version: #1 SMP PREEMPT_DYNAMIC Wed, 18 Sep 2024 19:02:04 +0000

GPU information: 00:02.0 VGA compatible controller [0300]: Intel Corporation WhiskeyLake-U GT2 [UHD Graphics 620] [8086:3ea0] (rev 02) (prog-if 00 [VGA controller])

os-release: NAME="Arch Linux" PRETTY_NAME="Arch Linux" ID=arch BUILD_ID=rolling ANSI_COLOR="38;2;23;147;209" HOME_URL="https://archlinux.org/" DOCUMENTATION_URL="https://wiki.archlinux.org/" SUPPORT_URL="https://bbs.archlinux.org/" BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues" PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/" LOGO=archlinux-logo

plugins:

Description

The Scroll Lock key on my RGB keyboard does not function as expected when using Hyprland on Arch Linux. The keyboard's RGB lights work fine on Windows 11, but they do not turn on in Arch Linux, even though the keyboard itself is recognized. I've tried multiple troubleshooting steps, including loading the i2c-dev module, modifying GRUB parameters, using xset, setleds, and OpenRGB. None of these solutions have resolved the issue.

Additionally, OpenRGB displays a warning message indicating that I2C/SMBus interfaces failed to initialize, which may be related to this problem. The issue persists, preventing me from controlling the keyboard's RGB lighting under Hyprland.

How to reproduce

Boot into Arch Linux with Hyprland as the window manager. Attempt to use the Scroll Lock key to toggle the RGB lighting on a keyboard with vendor ID 0xc0f4 and product ID 0x01f5. Observe that the RGB lighting does not turn on, and the Scroll Lock key has no effect.

Crash reports, logs, images, videos

OpenRGB warning message:

image

lsusb ─╯ Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 002: ID 0c45:671e Microdia Integrated_Webcam_HD Bus 001 Device 003: ID 0cf3:e009 Qualcomm Atheros Communications Bus 001 Device 005: ID 0bda:5411 Realtek Semiconductor Corp. RTS5411 Hub Bus 001 Device 006: ID c0f4:01f5 Usb KeyBoard Usb KeyBoard Bus 001 Device 007: ID 062a:4101 MosArt Semiconductor Corp. Wireless Keyboard/Mouse Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 002 Device 002: ID 174c:55aa ASMedia Technology Inc. ASM1051E SATA 6Gb/s bridge, ASM1053E SATA 6Gb/s bridge, ASM1153 SATA 3Gb/s bridge, ASM1153E SATA 6Gb/s bridge

vaxerski commented 1 month ago

does it work on kde or sway?

Also, thanks for letting me know it's RGB. That was very important.

sharjeelmazhar commented 1 month ago

like installing a kde system on bare metal and testing if scroll lock works or not?

Ghosthree3 commented 1 month ago

The scroll lock LED has never worked for me on Hyprland (though the key events themselves do work), but it doesn't work on Sway either.

vaxerski commented 1 month ago

like installing a kde system on bare metal and testing if scroll lock works or not?

or installing kde/sway on your current system, your choice

sharjeelmazhar commented 1 month ago

i will install arch linux kde on my external ssd and will let you know if it works or not

cathartyc commented 1 month ago

My findings with a Cooler Master Devastator II are that any external (I don't know about integrated ones) keyboard with the backlight (not really RGB, just a static green light in my case) toggled by the scroll-lock key will not have a working toggle on any Wayland compositor, by default.

I have solved this issue time ago, partially following the 2nd workaround presented here: essentially, we need to create a new XKB option.

Everything is done inside $XDG_CONFIG_DIR/xkb/ (i.e. $HOME/.config/xkb in most cases). What I did differently from the guide:

  1. my rules/evdev file contains
    
    ! option = symbols
    devastator:map_sclk = +scroll(map_to_mod3)

// Include the system 'evdev' file ! include %S/evdev

where `devastator:map_sclk` is the name I gave to the option and `scroll` is the name of the file described below;

2. in `symbols` I created a file, named `scroll`, that contains

default partial modifier_keys xkb_symbols "map_to_mod3" { modifier_map Mod3 { Scroll_Lock }; };



3. in my `hyprland.conf`, inside `input`, I added `devastator:map_sclk` in `kb_options`.

I never indulged too much on how does creating xkb options work, but my keyboard backlight worked correctly since then.
sharjeelmazhar commented 4 weeks ago

Thank you so much, @cathartyc I had completely given up on getting my keyboard backlight to work, and I was convinced it was a lost cause. But your solution worked like magic! I’m genuinely so glad to see my $10 keyboard's backlight finally turning on. If my keyboard can be fixed with your method, I’m sure any keyboard can work even if it doesn’t by default. You’re a lifesaver!