Skip to content

Linux configurable driver for 2-in-1 Asus laptops. Driver detects mode change to tablet/laptop and allows customization of each state.

License

Notifications You must be signed in to change notification settings

asus-linux-drivers/asus-fliplock-driver

Repository files navigation

Asus fliplock driver

License: GPLv2 Maintainer GitHub Release GitHub commits Hits

If you find the project useful, do not forget to give project a GitHub stars People already did!

Changelog

CHANGELOG.md

Features

  • When does not exist device Intel HID switches yet, driver will try find again every 5s and will use for first time flip event from Asus WMI hotkeys, concretely will catch configurable key, by default EV_KEY.KEY_PROG2
  • When you do not receive event EV_KEY.KEY_PROG2 neither switch tablet-mode state drivers work together with https://github.com/asus-linux-drivers/asus-accel-tablet-mode-driver (e.g. laptop UN5401QAB_UN5401QA and associated issue #3)
  • By default disable backlight of keyboard in tablet mode, Remember latest backlight levels via temp file located in /tmp
  • By default disable backlight of NumLock key in tablet mode
  • By default disable backlight of NumberPad in tablet mode, remember latest backlight level via temp file located in /tmp
  • By default disable backlight of MicMute key in tablet mode, remember latest backlight level via temp file located in /tmp

Requirements

  • (Optionally for disabling LEDs in tablet mode without kernel modules yet - e.g. preconfigured default for laptop UP5401EA) have mounted debugfs to /sys/kernel/debug/asus-nb-wmi from kernel modules asus-wmi, asus-nb-wmi

Preview

gif preview


Installation

You can get the latest ASUS fliplock driver for Linux from Git and install it using the following commands.

git clone https://github.com/asus-linux-drivers/asus-fliplock-driver
cd asus-fliplock-driver
sudo ./install.sh

To uninstall, just run:

sudo ./uninstall.sh

When you do not receive event KEY_PROG2 neither SWITCH_TOGGLE:

$ sudo libinput debug-events
...
-event4   DEVICE_ADDED     Asus WMI hotkeys                  seat0 default group11 cap:k
...
-event4   KEYBOARD_KEY     +0.623s	KEY_PROG2 (149) pressed
 event4   KEYBOARD_KEY     +0.623s	KEY_PROG2 (149) released
-event29  DEVICE_ADDED     Intel HID switches                seat0 default group16 cap:S
 event29  SWITCH_TOGGLE    +0.722s	switch tablet-mode state 1
-event29  SWITCH_TOGGLE    +1.174s	switch tablet-mode state 0
-event4   KEYBOARD_KEY     +1.175s	KEY_PROG2 (149) pressed
 event4   KEYBOARD_KEY     +1.175s	KEY_PROG2 (149) released

try install this driver together with https://github.com/asus-linux-drivers/asus-accel-tablet-mode-driver

Troubleshooting

To activate logger, do in a console:

LOG=DEBUG sudo -E ./asus_fliplock.py "default"

Existing similar projects

Why was this project created? Easy installation/uninstallation and with default config aimed for Asus laptops.