nix-community / plasma-manager

Manage KDE Plasma with Home Manager
https://nix-community.github.io/plasma-manager/
MIT License
604 stars 69 forks source link

Configuring LibInput devices #47

Open billy4479 opened 9 months ago

billy4479 commented 9 months ago

I happen to use natural scrolling and a few other options on my laptop touchpad. These option are set in ~/.config/kcminputrc as

[Libinput][10182][480][GXTP7863:00 27C6:01E0 Touchpad]
DisableWhileTyping=false
NaturalScroll=true
TapToClick=true

I'd like to use these same settings for any laptop I (will) use. As you can see the group name is kinda device-specific: for sure the last part ([GXTP7863:00 27C6:01E0 Touchpad]) is the name of the input device as it shows in libinput list-devices; I still haven't figured out what the other two numbers are ([10182] and [480]).

For now I can just hardcode them in my config but I don't think that's the best solution..

If someone manages to figure out what the other two numbers are we could query them at activation-time and have an option to enable or disable such features for any touchpad.

toast003 commented 8 months ago

Tried finding out what writes the numbers are by reading the source code for the mouse kcm but I haven't gotten anything yet

toast003 commented 8 months ago

This repo just puts setting under [Mouse] :thinking: I'll try it out EDIT: Don't think it works anymore (the config file I linked is 8 years old after all), but I'm doing other things so I can't log out or restart plasma, so maybe that's why it doesn't work

billy4479 commented 8 months ago

Tried finding out what writes the numbers are by reading the source code for the mouse kcm but I haven't gotten anything yet

Thanks for the link, I'll try to look into it too.

Also, I forgot to add in the original post that I'm using the Wayland session. Maybe the X11 session uses some other config (?), I'll try to login into a X session when I have time and I'll let you know if I find any difference.

toast003 commented 8 months ago

I'm also using Wayland 

11 Jan 2024, 12:09 pm by @.***:

Tried finding out what writes the numbers are by reading the >> source code for the mouse kcm https://invent.kde.org/plasma/plasma-desktop/-/tree/master/kcms/mouse>> but I haven't gotten anything yet

Thanks for the link, I'll try to look into it too.

Also, I forgot to add in the original post that I'm using the Wayland session. Maybe the X11 session uses some other config (?), I'll try to login into a X session when I have time and I'll let you know if I find any difference.

— Reply to this email directly, > view it on GitHub https://github.com/pjones/plasma-manager/issues/47#issuecomment-1886901035> , or > unsubscribe https://github.com/notifications/unsubscribe-auth/AJJUMAWVJV55G6LIT3SHUWDYN7B7FAVCNFSM6AAAAABBS3YC6CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBWHEYDCMBTGU> . You are receiving this because you commented.> Message ID: > <pjones/plasma-manager/issues/47/1886901035> @> github> .> com>

ribru17 commented 6 months ago

If someone manages to figure out what the other two numbers are we could query them at activation-time and have an option to enable or disable such features for any touchpad.

The first two numbers are the decimal representations of the middle (hexadecimal) numbers: e.g., for [Libinput][10182][480][GXTP7863:00 27C6:01E0 Touchpad]: 10182 = 0x27C6 480=0x1E0

ChocolateLoverRaj commented 6 months ago

I would like an option to enable reverse scrolling on all touchpads regardless of ID

toast003 commented 6 months ago

For usb devices the two numbers are the usb id in decimal, and the name is just the name of the device, for i2c devices (touchpads) the two numbers are some sort of id, then the name is the name of the device followed by it's name (how it shows up in /sys/bus/i2c/devices) followed by the id again in hex and then Touchpad

ribru17 commented 6 months ago

@toast003 So if we specifically want an option for touchpad behavior, we can just cat /proc/bus/input/devices | grep -i touchpad and deterministically extract the numbers from just before "Touchpad", using them to index the setting field?

Edit: we can grep the ID with cat /proc/bus/input/devices | grep -i touchpad | sed 's/N: Name=".* \(.*\) Touchpad"/\1/'

toast003 commented 5 months ago

We could do that, although I'm not sure if that's something that should be done in write_config.py or a new script