-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On Mon, 2016-12-05 at 21:23 +0000, 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?  > No. I meant I use these tools for a soft keyboard working across applications from different toolkits. > > 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. > Yes. This goes with the assumption that acpid will be a dependency. I, for example, have built my setup without the acpid daemon. For events, I simply rely on udev. > > > 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. > net.hadess.SensorProxy over the system bus. And the property is: AccelerometerOrientation Currently, it does not have any such property like, say, DeviceMode. Maybe something iio-sensor-proxy could add ? > 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. > None to the best of my knowledge. > 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/. > ± There is this key code (mentioned above) that is registered when getting into tablet mode. But that is pretty much it. No similar stuff when switching back to normal mode. Below are the list of events. NOthing reliable to base assumptions on. KERNEL[19987.255649] add      /devices/pci0000:00/0000:00:14.0/usb2/2-4 (usb) KERNEL[19987.256792] add      /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4:1.0 (usb) KERNEL[19987.259993] add      /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_sdmmc.0.auto (platform) KERNEL[19987.260097] add      /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_sdmmc.0.auto/leds/mmc0:: (leds) KERNEL[19987.260186] add      /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_sdmmc.0.auto/mmc_host/mmc0 (mmc_host) KERNEL[19987.260240] change   /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_sdmmc.0.auto/leds/mmc0:: (leds) KERNEL[19987.260352] add      /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_ms.1.auto (platform) KERNEL[19987.260543] add      /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_ms.1.auto/memstick_host/memstick0 (memstick_host) KERNEL[19987.574655] change   /devices/pci0000:00/0000:00:02.0/drm/card0/card0- eDP-1/intel_backlight (backlight) UDEV  [19987.578841] change   /devices/pci0000:00/0000:00:02.0/drm/card0/card0- eDP-1/intel_backlight (backlight) UDEV  [19989.847676] add      /devices/pci0000:00/0000:00:14.0/usb2/2-4 (usb) KERNEL[19990.179895] change   /devices/pci0000:00/0000:00:02.0/drm/card0/card0- eDP-1/intel_backlight (backlight) UDEV  [19990.181717] change   /devices/pci0000:00/0000:00:02.0/drm/card0/card0- eDP-1/intel_backlight (backlight) UDEV  [19992.077444] add      /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4:1.0 (usb) UDEV  [19992.080723] add      /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_ms.1.auto (platform) UDEV  [19992.081034] add      /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_sdmmc.0.auto (platform) UDEV  [19992.083209] add      /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_ms.1.auto/memstick_host/memstick0 (memstick_host) UDEV  [19992.084383] add      /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_sdmmc.0.auto/leds/mmc0:: (leds) UDEV  [19992.084907] add      /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_sdmmc.0.auto/mmc_host/mmc0 (mmc_host) UDEV  [19992.086865] change   /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_sdmmc.0.auto/leds/mmc0:: (leds) KERNEL[20009.568333] remove   /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_ms.1.auto/memstick_host/memstick0 (memstick_host) KERNEL[20009.568424] remove   /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_ms.1.auto (platform) KERNEL[20009.569762] remove   /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_sdmmc.0.auto/mmc_host/mmc0 (mmc_host) KERNEL[20009.569840] change   /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_sdmmc.0.auto/leds/mmc0:: (leds) KERNEL[20009.569887] remove   /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_sdmmc.0.auto/leds/mmc0:: (leds) KERNEL[20009.569941] remove   /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_sdmmc.0.auto (platform) KERNEL[20009.570020] remove   /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4:1.0 (usb) UDEV  [20009.570981] remove   /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_ms.1.auto/memstick_host/memstick0 (memstick_host) UDEV  [20009.571967] remove   /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_sdmmc.0.auto/mmc_host/mmc0 (mmc_host) UDEV  [20009.572048] remove   /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_ms.1.auto (platform) KERNEL[20009.572280] remove   /devices/pci0000:00/0000:00:14.0/usb2/2-4 (usb) UDEV  [20009.573511] change   /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_sdmmc.0.auto/leds/mmc0:: (leds) UDEV  [20009.574408] remove   /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_sdmmc.0.auto/leds/mmc0:: (leds) UDEV  [20009.575152] remove   /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_sdmmc.0.auto (platform) UDEV  [20009.576125] remove   /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4:1.0 (usb) UDEV  [20009.577906] remove   /devices/pci0000:00/0000:00:14.0/usb2/2-4 (usb) KERNEL[20027.472994] add      /devices/pci0000:00/0000:00:14.0/usb2/2-4 (usb) KERNEL[20027.474205] add      /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4:1.0 (usb) KERNEL[20027.475296] add      /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_sdmmc.0.auto (platform) KERNEL[20027.475360] add      /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_sdmmc.0.auto/leds/mmc0:: (leds) KERNEL[20027.475553] add      /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_sdmmc.0.auto/mmc_host/mmc0 (mmc_host) KERNEL[20027.475673] change   /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_sdmmc.0.auto/leds/mmc0:: (leds) KERNEL[20027.475739] add      /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_ms.1.auto (platform) KERNEL[20027.476975] add      /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_ms.1.auto/memstick_host/memstick0 (memstick_host) KERNEL[20027.777224] change   /devices/pci0000:00/0000:00:02.0/drm/card0/card0- eDP-1/intel_backlight (backlight) UDEV  [20027.778405] change   /devices/pci0000:00/0000:00:02.0/drm/card0/card0- eDP-1/intel_backlight (backlight) UDEV  [20029.709487] add      /devices/pci0000:00/0000:00:14.0/usb2/2-4 (usb) KERNEL[20030.022078] change   /devices/pci0000:00/0000:00:02.0/drm/card0/card0- eDP-1/intel_backlight (backlight) UDEV  [20030.022660] change   /devices/pci0000:00/0000:00:02.0/drm/card0/card0- eDP-1/intel_backlight (backlight) UDEV  [20031.943641] add      /devices/pci0000:00/0000:00:14.0/usb2/2-4/2-4:1.0 (usb) UDEV  [20031.945688] add      /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_sdmmc.0.auto (platform) UDEV  [20031.945759] add      /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_ms.1.auto (platform) UDEV  [20031.947793] add      /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_sdmmc.0.auto/leds/mmc0:: (leds) UDEV  [20031.948034] add      /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_sdmmc.0.auto/mmc_host/mmc0 (mmc_host) UDEV  [20031.949035] add      /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_ms.1.auto/memstick_host/memstick0 (memstick_host) UDEV  [20031.949353] change   /devices/pci0000:00/0000:00:14.0/usb2/2-4/2- 4:1.0/rtsx_usb_sdmmc.0.auto/leds/mmc0:: (leds) ^C2016-12-06 / 14:00:29 ♒♒♒  ☺   > 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? > I'll try this out. I don't have acpid installed right now. > 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). > Here's the output from kacpimon. rrs@learner:/var/tmp$ sudo kacpimon  Kernel ACPI Event Monitor... open for /proc/acpi/event: No such file or directory (2)   (ACPI proc filesystem may not be present) /dev/input/event0 (AT Translated Set 2 keyboard) opened successfully /dev/input/event1 (Power Button) opened successfully /dev/input/event10 (HDA Intel PCH Front Headphone) opened successfully /dev/input/event11 (HDA Intel HDMI HDMI/DP,pcm=3) opened successfully /dev/input/event12 (HDA Intel HDMI HDMI/DP,pcm=7) opened successfully /dev/input/event13 (HDA Intel HDMI HDMI/DP,pcm=8) opened successfully /dev/input/event14 (Lenovo EasyCamera) opened successfully /dev/input/event15 (ELAN Touchscreen) opened successfully /dev/input/event2 (Lid Switch) opened successfully /dev/input/event3 (Power Button) opened successfully /dev/input/event4 (Video Bus) opened successfully /dev/input/event5 (SynPS/2 Synaptics TouchPad) opened successfully /dev/input/event6 (Ideapad extra buttons) opened successfully /dev/input/event7 (PC Speaker) opened successfully /dev/input/event8 (HDA Digital PCBeep) opened successfully /dev/input/event9 (HDA Intel PCH Mic) opened successfully Netlink ACPI Family ID: 23 Netlink ACPI Multicast Group ID: 2 netlink opened successfully Press Escape to exit, or Ctrl-C if that doesn't work. Input Layer:  Type: 4  Code: 4  Value: 28 Input Layer:  Type: 1  Code: 28  Value: 0 Input Layer:  Sync Input Layer:  Type: 4  Code: 4  Value: 9 Input Layer:  Type: 1  Code: 9  Value: 1 Input Layer:  Sync 8Input Layer:  Type: 4  Code: 4  Value: 206 Input Layer:  Type: 1  Code: 118  Value: 1 Input Layer:  Sync ±Input Layer:  Type: 4  Code: 4  Value: 66 Input Layer:  Type: 1  Code: 193  Value: 1 Input Layer:  Sync Input Layer:  Type: 1  Code: 193  Value: 0 Input Layer:  Sync Input Layer:  Type: 4  Code: 4  Value: 206 Input Layer:  Type: 1  Code: 118  Value: 0 Input Layer:  Sync Input Layer:  Type: 4  Code: 4  Value: 9 Input Layer:  Type: 1  Code: 9  Value: 0 Input Layer:  Sync Input Layer:  Type: 4  Code: 4  Value: 190 Input Layer:  Sync Input Layer:  Type: 4  Code: 4  Value: 67 Input Layer:  Type: 1  Code: 192  Value: 1 Input Layer:  Sync Input Layer:  Type: 1  Code: 192  Value: 0 Input Layer:  Sync Input Layer:  Type: 4  Code: 4  Value: 190 Input Layer:  Sync Input Layer:  Type: 4  Code: 4  Value: 1 Escape key pressed Input Layer:  Type: 1  Code: 1  Value: 1 Closing files... ^[Goodbye 2016-12-06 / 14:05:51 ♒♒♒  ☺   - -- Ritesh Raj Sarraf RESEARCHUT - http://www.researchut.com "Necessity is the mother of invention." -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEQCVDstmIVAB/Yn02pjpYo/LhdWkFAlhGeRIACgkQpjpYo/Lh dWkwbA/+I5M98UQCyJRYyy+46zbfLW5o3NZ2TSsuePn/d14hK8b1iXRhAKLj901u HphmKWGIumnYFSRaUNUpZOkm5pLVU0ETrAG1jAI3m/e1vRtVR+FzQh8cpyCwYEsO 9G8LDy9uLilpwpSb7XILWpXf0a0QsbB/ouUDfLlXNv7LednRAX1NlQxd7eZQeuDu 5kPtzZrJ+vFU0hDj54etNnIS2ZaBF77cZA3DQWlXs4FooupODUsviUHQXLAtUd1o pK/U2bQY42TQNIC0A61RVTbN561kC391jr0q7UdYSuasxhcTYK6AVxbRd2eGFWIh b5QyzfRuR3b5l9zefbGfkaPb/WYPh7O0OZ0jXENzE7/oOS+VulhRF6zbOQHDEVzN XciQLU/Bv8WFpZXkQ/ZfoVRkfOMCFw7KRffIPqeGyoG2GngpWNOw5f3MGsOp8TtY 1qN9mYzEvPoU4tJFIsVPKC31r0d8uF683BGmnS4dgUSjDCyNjheGe1jdGSW2DRkV z88s5smos8slyYwlJIOdtT+0JtvQqFwJTwc2ZWBOxrB2aA5uj+BD6/EJayBDNV0g Dc4crxaYF20Dpp6GN6n9Gx06KYtuaA8pk+LykWz5eRdjY56J5zzm1VKbxBYTi4xq yWb7GN1SXgb5gOBZeSvw7KSYkCs01PHfsHHtvFqjvRHmQ8XrKaE= =HLhc -----END PGP SIGNATURE-----