Tablet-switch is a systemtray program to manually toggle different operating modes for your 2-in-1 on Linux.
This is what the different operating modes do:
tablet-switch currently works on my HP ENVY x360 Convertable 13-ay1035nr.
It should work on other laptops with a similar tablet switch device.
tablet-switch will find 2-in-1 tablet switch devices which have the event codes EV_SW
,SW_TABLET_MODE
.
Those devices will be populated in the settings ui where they can then be selected and toggled.
Upon selecting either Tablet mode or Stylus Only Mode, a SW_TABLET_MODE
event will be emitted via the tablet switch input device.
In my case the tablet switch input device is HP WMI Hotkeys
.
The SW_TABLET_MODE
event will alert the operating system that the computer is in tablet mode.
Gnome for instance will disable the keyboard and trackpad while enabling the on screen keyboard and screen rotation.
Review the code.
Clone the repository
$ git clone https://github.com/ademarest/tablet-switch.git
Change directory into the git repository
$ cd ./tablet-switch
Compile tablet-switch
$ ./compile.sh
Add the user which will run tablet-switch to the input group.
$ sudo useradd -aG input $USER
The following packages are required to run this on ArchLinux
tablet-switch can now be executed as a program.
$ cd ./build && ./tablet-switch