Skip to main content
Topic: X Settings for Specific Keyboard and Learning More about Xorg (Read 775 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

X Settings for Specific Keyboard and Learning More about Xorg

Hello all,

Currently I have a unicomp endurapro, a keyboard with a pointing stick and two mouse buttons. I have followed some of Arch Linux's wiki, and some other forums' advice, to get right click scroll working (hold right click on keyboard, and use pointing stick to scroll) which is handy when I don't want to use my mouse. Whenever I want this feature, I have to run this script that I made:

Code: [Select]
#!/bin/bash
# Interestingly enough, I have to enable both of these to get the trackpoint scroll emulation working.

xinput set-prop "pointer:Unicomp Inc Unicomp 10x Kbrd R7_2_w_PS_R7_38" "libinput Button Scrolling Button" 3
xinput --set-prop 'pointer:Unicomp Inc Unicomp 10x Kbrd R7_2_w_PS_R7_38' 'libinput Scroll Method Enabled' 0 0 1

The problem is, every time I unplug this keyboard, I have to run this script again to get the right click scrolling working. This keyboard is hooked up to a dock, that I dock and undock my laptop from, so it is unplugged frequently. Is there a file I can enter these settings that will make sure these will run when this specific keyboard is plugged in, to make this change permanent?
(I don't want to put this code in .bashrc, or anything like that, because it will spew out errors when the keyboard is unplugged and there is probably a better way anways.)

Also, I want to learn more about Xorg and how it works, are there any good resources for learning how it works, besides the Arch Wiki?

Thanks for any help on this matter.

Re: X Settings for Specific Keyboard and Learning More about Xorg

Reply #1
The keyboard and mouse (trackpoint) would show up in here:
/dev/input/by-path/
So you could test for their existence in a boot time script. But probably udev would be better as it would detect hotplug events if you needed:
https://www.tecmint.com/udev-for-device-detection-management-in-linux/

Re: X Settings for Specific Keyboard and Learning More about Xorg

Reply #2
I'll have a look into udev then, thank you. I've always wondered what it does.