alesya-h / linux_detect_tablet_mode

Detect if your laptop is in normal or tablet mode. Useful for Yoga laptops to disable keyboard/trackpoint/touchpad in a tablet mode
MIT License
137 stars 29 forks source link

Requires root to work #23

Closed lululock71 closed 2 years ago

lululock71 commented 3 years ago

Hi, The script requires root privileges because it uses xinit... So I can't have it started from my .xinitrc file at logon. Is there a way to quickly fix this ?

alesya-h commented 3 years ago

Hi. It doesn't use xinit (I can't even think of why it would use it) and it doesn't require root. It needs access to input devices, but for that you would just need to add your user to the input group. It does work when started from .xinitrc - I used it myself that way and other users also run it this way. You may have seen xinput rather than xinit but that is not part of the script but rather a part of an example configuration - it is used to enable/disable keyboard and touchpad when switching between tablet and normal modes. It doesn't require root either, but you might want to update it's parameters to match your hardware.

lululock71 commented 3 years ago

Hi, I was dumb and forgot to add the user into the input group. And yeah, I wrote "xinit" while I meant "xinput". Sorry for making you loose time and I appreciate you took the time to answer a such dumb question. I was tired, read too fast and missed steps. It works flawlessly now on my Yoga 370. Any place where I can put the config file for others to use it ?

jclsn commented 2 years ago

@alesya-h It requires root for me as well, althoug I am in the input and tablet group. Can you please look into this? It doesn't automatically start when putting it in .xinitrc.

EDIT: So after reinstalling it worked without root. .xinitrc did not work for me though. I had to add it to the KDE autostart list. I also tried creating a system service. Weird that that didn't work.