This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Force tablet mode/ falsefully unsupported device tp L13 yoga

Tags: None
(comma "," separated)
jackley
Registered Member
Posts
3
Karma
0
Hello.
Have a laptop Lenovo thinkpad L13 yoga.

The problem with it is that Linux does not recognise tablet mode switch sensor,
nothing posted in /dev/input/* when lid is rotated backwards 360°.
Device type reported by kernel is "10" which means regular laptop.

As a workaround I was thinking about running Plasma on X11 and disabling kb/touchpad using xinput.
But Plasma still does not allow autorotation.

Found dbus-send variable but it is readonly:
$ dbus-send --session --print-reply --dest=org.kde.KWin /org/kde/KWin org.freedesktop.DBus.Properties.Set string:"org.kde.KWin.TabletModeManager" string:"tabletModeAvailable" variant:boolean:true
Error org.freedesktop.DBus.Error.PropertyReadOnly: Property org.kde.KWin.TabletModeManager.tabletModeAvailable is read-only
$ dbus-send --session --print-reply --dest=org.kde.KWin /org/kde/KWin org.freedesktop.DBus.Properties.Set string:"org.kde.KWin.TabletModeManager" string:"tabletMode" variant:boolean:true
Error org.freedesktop.DBus.Error.PropertyReadOnly: Property org.kde.KWin.TabletModeManager.tabletMode is read-only

Question: is there a way to force tablet mode in KDE Plasma? Acceptable for me would be to have an on-screen toggle or swipe gesture to toggle this variable.
Any suggestions?
User avatar
claydoh
Registered Member
Posts
1170
Karma
9
OS
ArmI am not sure iif /dev/input is what is used for this on modern hardware.

The specifics will depend on the distro. If you haven't already, you need to make sure you have iio-sensors-proxy installed.
Then run monitor-sensor to see if something is triggered or not

Some starting points, maybe:
viewtopic.php?f=17&t=174926

For rotation in X11, you can probably find some scripts for similar hardware to yours that can be edited to work, but xorg is a huge pita for this
hopefully you are just missing iio-sesnors.

When I had my convertible lenovo laptop, Wayland work great on it, but I did have to un-check the option to rotate only in tablet mode. So no 'tablet mode', but there is not much missed there.


claydoh, proud to be a member of KDE forums since 2008-Oct, and KDE user since 2001
jackley
Registered Member
Posts
3
Karma
0
Running Fedora, tried Ubuntu 22.04 and Manjaro. Same result, Lenovo wrote sensor driver for windows and ignored Linux.
iio-sensors installed,
monitor-sensor result:
Waiting for iio-sensor-proxy to appear
+++ iio-sensor-proxy appeared
=== Has accelerometer (orientation: normal)
=== No ambient light sensor
=== No proximity sensor
Accelerometer orientation changed: bottom-up
Accelerometer orientation changed: normal

The problem is keyboard/touchpad in flipped mode and I was thinking forcing tablet mode would be the cleanest workaround.
Even triggering tablet mode if orientation changed to anything other than normal would work for me.

If the only option is X11, so be it, but still hoping to find more elegant solution. Wayland is the future right? =)
User avatar
claydoh
Registered Member
Posts
1170
Karma
9
OS
You haven't said what the problem is with the keyboard and touchpad. I am assuming that with iio-sensors-proxy up and running, the pad and keyboard are not getting disabled?

On my Lenovo Flex 15, the keyboard and touchpad are switched off in hardware when rotated/flipped - they are still detected by the OS as present, they are definitely not disabled or turned off, just no input registers.

Tablet Mode in Plasma is just a UI tweak, anyway. Slightly larger interface. Very slightly. It does not effect the hardware, it is actually the other way around: it is enabled by the hardware sensors so enabling it won't fix any issues you have. At least that is how I understand it from sort of being where you are in the past. I somehow kept missing your point on this, and should have brought that up in the beginning. Apologies for that.

However, with xorg, and xrandr and xinput you can rotate and shift All The Things. But will take some scripting and investigative work to automate it.
So this is going to be much more a hardware thing than anything specific to KDE.


claydoh, proud to be a member of KDE forums since 2008-Oct, and KDE user since 2001
jackley
Registered Member
Posts
3
Karma
0
Thank You for your input.
Yes, the problem is keyboard/touchpad/trackpoint not being disabled when screen is flipped around and rotation not activated.
And all of that is because laptop is not recognised as convertible, which is because switch-to-tablet sensor was not recognised by system.

The main question is: Is it possible to have a switch/command/button to trick Plasma into thinking it runs on a tablet. Than plasma will disable keyboard input and enable rotation with no additional scripting needed.

As I said before I found where Plasma keeps those variables but they are read-only. Could there options to overwrite vars in there:
$ dbus-send --session --print-reply --dest=org.kde.KWin /org/kde/KWin org.freedesktop.DBus.Properties.Set string:"org.kde.KWin.TabletModeManager" string:"tabletMode" variant:boolean:true
Error org.freedesktop.DBus.Error.PropertyReadOnly: Property org.kde.KWin.TabletModeManager.tabletMode is read-only


just wanted to hear from plasma community/devs is it possible to solve more elegant before I go back to my cave to play with bash, xrandr and xinput.
User avatar
claydoh
Registered Member
Posts
1170
Karma
9
OS
When Plasma detects that system has registered Tablet Mode, it is only changing some UI bits, not doing any hardware controlling. That is all in your kernel version and libinput.

I might be incorrect in this, but I am 99% sure this is the case here.


claydoh, proud to be a member of KDE forums since 2008-Oct, and KDE user since 2001


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]