GithubHelp home page GithubHelp logo

asus-linux-drivers / asus-fliplock-driver Goto Github PK

View Code? Open in Web Editor NEW
24.0 3.0 3.0 14.75 MB

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

License: GNU General Public License v2.0

Python 69.45% Shell 30.55%
driver linux fliplock 2in1 laptop-mode libinput backlight-keyboard backlight-capslock asus tablet

asus-fliplock-driver's Introduction

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.

asus-fliplock-driver's People

Contributors

ldrahnik avatar mark12870 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

asus-fliplock-driver's Issues

Keyboard not working on ASUS Expertbook

Hi there!

Me again, so I tried this driver out for my ASUS Expertbook and it partially (led switches etc) worked but my keyboard still doesn't work ๐Ÿ˜ข...

See: asus-linux-drivers/asus-accel-tablet-mode-driver#4

Below some debug logs I have used to troubleshoot but no result...

Logs are for these steps:
1: uninstall driver
2: run libinput
3: run python script
4: flip keyboard behind the screen and back to normal

For the reference: after flips I click a few times on Super/CapsLock/Space and other keys but no events are visible in libinput... BUT! some Fn keys work just fine, such as KEY_BRIGHTNESSDOWN and KEY_BRIGHTNESSUP...

image

I would really appreciate some help from anyone!

Is it another kernel bug or am I missing something?

Thank you anyways for your time!

Cheers, Sviatoslav

Cant Boot into Desktop after installation

I have an Asus VivoBook Flip 14 TM420UA and tried to install this on Manjaro Gnome after I had already successfully installed numpad driver(so thx for the great work btw),
but unfortunately after I logged into my user account the screen would just stay black(though the mouse showed up for a few seconds) and when I tried to bring up the numpad it would turn off soon after it appeared.

The only option I had left was to uninstall both drivers from the tty because just uninstalling the asus-fliplock-driver wasn't enough.

Before that I also tried to uncomment the # ExecStartPre=/bin/sleep 2 but this didnt help, though I only did that for the fliplock driver not the touchpad driver so I am not sure if this could have been the issue (also it worked before when I just had the numpad driver running).

What could I do to get this running?

Fliplock driver permission error

I installed it with sudo ./install.sh, as you said to and have your accel driver installed too, which is sending it tablet mode correctly i think. It is certinally flipping the screen anyway.
I think its something to do with the device that im using not being the defult one for you. I have a Asus vivobook S14 flip (TN3402Y non OLED)

The log is:
m@Ms-Vivobook:~/asus-fliplock-driver$ LOG=DEBUG sudo -E ./asus_fliplock.py "default"
DEBUG:Asus fliplock:Detect wmi hotkeys from N: Name="Asus WMI accel tablet mode"
DEBUG:Asus fliplock:Set wmi hotkeys id 19 from H: Handlers=kbd event19
DEBUG:Asus fliplock:InputEvent(EV_KEY, KEY_PROG2, 1)
3
0
0
0
0
0
tee: /sys/kernel/debug/asus-nb-wmi/dev_id: Operation not permitted
tee: /sys/kernel/debug/asus-nb-wmi/dev_id: Operation not permitted
DEBUG:Asus fliplock:InputEvent(EV_SYN, SYN_REPORT, 0)
DEBUG:Asus fliplock:InputEvent(EV_KEY, KEY_PROG2, 0)
DEBUG:Asus fliplock:InputEvent(EV_SYN, SYN_REPORT, 0)
DEBUG:Asus fliplock:InputEvent(EV_SW, SW_TABLET_MODE, 1)
DEBUG:Asus fliplock:InputEvent(EV_SYN, SYN_REPORT, 0)
DEBUG:Asus fliplock:InputEvent(EV_KEY, KEY_PROG2, 1)
3
0
0
DEBUG:Asus fliplock:InputEvent(EV_SYN, SYN_REPORT, 0)
DEBUG:Asus fliplock:InputEvent(EV_KEY, KEY_PROG2, 0)
DEBUG:Asus fliplock:InputEvent(EV_SYN, SYN_REPORT, 0)
DEBUG:Asus fliplock:InputEvent(EV_SW, SW_TABLET_MODE, 0)
DEBUG:Asus fliplock:InputEvent(EV_SYN, SYN_REPORT, 0)
DEBUG:Asus fliplock:InputEvent(EV_KEY, KEY_PROG2, 1)
0
0
0
0
0
0
tee: /sys/kernel/debug/asus-nb-wmi/dev_id: Operation not permitted
tee: /sys/kernel/debug/asus-nb-wmi/dev_id: Operation not permitted
DEBUG:Asus fliplock:InputEvent(EV_SYN, SYN_REPORT, 0)
DEBUG:Asus fliplock:InputEvent(EV_KEY, KEY_PROG2, 0)
DEBUG:Asus fliplock:InputEvent(EV_SYN, SYN_REPORT, 0)
DEBUG:Asus fliplock:InputEvent(EV_SW, SW_TABLET_MODE, 1)
DEBUG:Asus fliplock:InputEvent(EV_SYN, SYN_REPORT, 0)
DEBUG:Asus fliplock:InputEvent(EV_KEY, KEY_PROG2, 1)
0
0
0

Not working with Zenbook 14 Flip OLED (UN5401, AMD Ryzen 5000 Series)

Is it supposed to work with this device? I installed it in manjaro as per the instructions, and it installed successfully and even enabled the service. But rotating the screen is still not disabling touchpad and keyboard.

Running the troubleshooting step shows the following:
DEBUG:Asus fliplock:Detect wmi hotkeys from N: Name="Asus WMI hotkeys"
DEBUG:Asus fliplock:Set wmi hotkeys id 4 from H: Handlers=kbd event4 rfkill

I rotated the screen too to see any additional log was generated but this was it. Please inform if I should provide any more info if necessary

It doesn't work on Asus Zenbook Flip 14 UN5401Q (AMD)

Device: Asus Zenbook Flip 14 UN5401Q (ASUSTeK COMPUTER INC. Zenbook UN5401QAB_UN5401QA)
OS: Ubuntu 22.04.1 LTS

When I flip the device, nothing happens.

Debug log:

marek@marek-zenbook:~/Downloads/asus-fliplock-driver-master$ LOG=DEBUG sudo -E ./asus_fliplock.py
[sudo] password for marek: 
DEBUG:Asus fliplock:Detect wmi hotkeys from N: Name="Asus WMI hotkeys"
DEBUG:Asus fliplock:Set wmi hotkeys id 4 from H: Handlers=rfkill kbd event4

Doesn't work on zenbook 14.

Nothing happens after installing the driver. The numpad does not turn on and the keyboard does not turn off. I have the amd version.
Log:
DEBUG:Asus fliplock:Detect wmi hotkeys from N: Name="Asus WMI hotkeys" DEBUG:Asus fliplock:Set wmi hotkeys id 14 from H: Handlers=rfkill kbd event14

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.