Comment 29 for bug 1366421

Revision history for this message
marmuta (marmuta) wrote :

> Yes. I use this mode, here, on Debian too.
Do you mean you can query if your system is in tablet-mode through AT-SPI?

> Umm.. I'm not sure if acpi events really trap that event.
I'm not sure either, it just seemed like a logical place to look at.

There's a bit more stuff in /etc/acpi/events on my Ubuntu Zesty system
ll /etc/acpi/events/
total 36K
-rw-r--r-- 1 root root 271 Mai 1 2013 asus-keyboard-backlight-down
-rw-r--r-- 1 root root 265 Mai 1 2013 asus-keyboard-backlight-up
-rw-r--r-- 1 root root 73 Mai 1 2013 asus-wireless-off
-rw-r--r-- 1 root root 72 Mai 1 2013 asus-wireless-on
-rw-r--r-- 1 root root 223 Mai 1 2013 ibm-wireless
-rw-r--r-- 1 root root 67 Mai 1 2013 lenovo-undock
-rw-r--r-- 1 root root 423 Apr 3 2014 powerbtn
-rw-r--r-- 1 root root 277 Mai 1 2013 thinkpad-cmos
-rw-r--r-- 1 root root 222 Mai 1 2013 tosh-wireless

Also, the bug report I linked above uses scripts in this directory for exactly what we need - calling stuff when tablet-mode is entered or left.

> Are you looking for something like the following ?
>
> Connected to D-Bus.
>
> Received reply from :1.5
> Arguments: [Variant(QString): "normal"]
> Received reply from :1.5
> Arguments: [Variant(QString): "right-up"]
Possibly, this output seems to be related more to device orientation though. I'm not sure that's sufficient to detect the laptop-mode/tablet-mode switch. What object, interface and property is this coming from? You should be able to find that printed somewhere above that snippet.

I've been reading a bit. The Yoga 2 is advertised as having four distinct modes: Laptop, Tablet, Tent, Stand. I'm unclear about how much of that can be detected by software, but if there exist one or more hardware switches supported by the linux kernel, then I believe they would have to be visible in /dev/input.

Apparently there used to exist a /proc/acpi/event, but that has been deprecated and replaced by evdev devices in /dev/input.

acpid reads from /dev/input/event* and maps key-strokes generated by system buttons to actions and scripts in /etc/acpi/events/.

I would try the following:
sudo systemctl stop acpid # shutdown acpid
sudo acpid --foreground --debug --logevents # restart with logging

That should give a log of events being received and actions executed.
Then fold the device to laptop configuration and back to tablet-mode. Does it print anything interesting in either case?

There's also kacpimon you can try. Maybe that one catches more events, I'm not sure.
sudo systemctl stop acpid # shutdown acpid
sudo kacpimon
Same, move screen to laptop-mode and back to tablet-mode and see if there is anything helpful in the output (or attach everything here).