rvaiya / keyd

A key remapping daemon for linux.
MIT License
2.54k stars 155 forks source link

Userspace LED events not working while using keyd (again?) #715

Open MeemeeLab opened 3 months ago

MeemeeLab commented 3 months ago

First of all, thanks for this useful project. I appreciate your work!

I have problem that seems like a duplicate of #531 which is fixed, but on my side it's not fixed. I don't know this bug happened once again or problem on my side, but I think this is worth reporting.

I'm trying to execute:

# echo 0 | tee /sys/class/leds/input43\:\:capslock/brightness
# echo 1 | tee /sys/class/leds/input43\:\:capslock/brightness

Which should change status LED of my keyboard.

If I start keyd (I'm currently using systemd), this stops working and stopping keyd makes this work again.

brightnessctl stops working when using keyd too:

$ brightnessctl --device=input*::numlock s 0
$ brightnessctl --device=input*::numlock s 1

All of my status LEDs on my keyboard including NumLock, CapsLock and ScrollLock doesn't seem to work.

My keyboard is REALFORCE R3, which have Japanese layout.

Arch Linux rolling
Linux 6.8.4-arch1-1 x86_64 GNU/Linux

Compositor: Wayland/Sway
cry0x11 commented 2 months ago

I have the same issue. You are not alone

uwidev commented 1 month ago

I also have this issue.

I have a Thinkpad T480, and it also has LEDs for mute and microphone, the latter of which doesn't seem to be detected by keyd -m. These LEDs work.

Likewise with you two, capslock does not work. Manually changing by either directly through sys or through brightnessctl does not work either.

I did some more testing and had an empty config, such that my device name outputed on keyd -m is my physical keyboard and not the virtual keyboard. Even in this case, capslock LED does not work.

I'm running Arch on Wayland Hyprland. I tried disabling Hyprland on startup so I could just be at tty. It also does not here as well.

uwidev commented 1 month ago

Capslock LED is working as of a few days ago. I patched my system sometime ago so it probably got fixed then. Try updating your system.

warrior0x7 commented 1 month ago

Capslock LED is working as of a few days ago. I patched my system sometime ago so it probably got fixed then. Try updating your system.

For some reason it's still not working. I came up with a temporary solution.

I put this to autostart with my window manager and it updates my bar to show the state of capslock.

This is EWW bar but you can use whatever you like ... just remove eww update <VARIABLE>=<VALUE> and add your own commands.

#!/usr/bin/env bash

toggle=0
keyd monitor | stdbuf -o0 grep --color=never "capslock down" | while IFS= read -r line;
do
    if [[ "$line" =~ "capslock down"$ ]]; then
        if [ $toggle -eq 0 ]; then
            eww update rev_caps=true
            toggle=1
        elif [ $toggle -eq 1 ]; then
            eww update rev_caps=false
            toggle=0
        fi
    fi
done