Convertibles and Manjaro ?!

Hello,

I am using Manjaro kde and i am quite happy with it! All worked out of the box except the automatic screen rotation / tablet mode...

Other users had isshues when using screen rotation that the inputs from stylus and so on are not inverted.

therefor here my final solution untill now :slight_smile:
one needs the iio-sensor-proxy from Guido Günter and xinput for stylus etc.

once that works the process is started with "monitor-sensor | ./file.py".
Since i am not using direct access to the iio deamon this could propably be implemented way more efficient but it works fine for me !

#!/usr/bin/env python3
import subprocess
import os
import sys

# --- set the name of the screen and the rotate direction below
screen = "eDP"
rotate = "inverted"

TRANSFORM = 'Coordinate Transformation Matrix'
TOUCHPAD = 'Wacom HID 51C4 Finger'
TOUCHSCREEN = "16"
ERASER = 'Wacom HID 51C4 Pen Eraser (0x9fd486a4)'

for line in sys.stdin:
    if "up" in line:
        # Tablet Mode
        subprocess.Popen(["onboard", "&"])  # simple monitor keyboard
        subprocess.call(["xrandr", "-o", rotate])
        subprocess.call([
            "xinput", "set-prop", TOUCHPAD, TRANSFORM, "-1", "0", "1", "0", "-1",
            "1", "0", "0", "1"
        ])
        subprocess.call([
            "xinput", "set-prop", TOUCHSCREEN, TRANSFORM, "-1", "0", "1", "0",
            "-1", "1", "0", "0", "1"
        ])
        subprocess.call([
            "xinput", "set-prop", ERASER, TRANSFORM, "-1", "0", "1", "0", "-1",
            "1", "0", "0", "1"
        ])
        subprocess.call(["onboard", "&"])
    elif "normal" in line:
        # normal Mode
    
        subprocess.Popen(["killall", "onboard"])
        subprocess.call(["xrandr", "-o", "normal"])
        subprocess.call([
            "xinput", "set-prop", TOUCHPAD, TRANSFORM, "0", "0", "0", "0", "0",
            "0", "0", "0", "0"
        ])
        subprocess.call([
            "xinput", "set-prop", TOUCHSCREEN, TRANSFORM, "0", "0", "0", "0", "0",
            "0", "0", "0", "0"
        ])
        subprocess.call([
            "xinput", "set-prop", ERASER, TRANSFORM, "0", "0", "0", "0", "0", "0",
            "0", "0", "0"
        ])

since i only want my laptop to turn upside down if i flip it and dont like it sideways i just implemented the flip for the two cases but shouldn't be realy a great issue to do such things aswel !

hope this is helpful for some people who strugle with the setup aswel !
if this is not detailed enugh just tell me and i will try my best to make it more clear :slight_smile:

1 Like

Automatric screen rotation in KDE Plasma should be supported with Plasma 5.19 (due to release in June).
It's needed for the Plasma Mobile too. :slight_smile:

2 Likes

Good to know looking Forward to Testing that :ok_hand:

Ive been using Plasma on my asus t100ta convertable. and its okay, i keep getting a weird issue when I try to scroll by dragging the scroll bar down with my finger. doesn't matter if its firefox or anything.

Ive been trying plasma mobile on it and it "works" so thats nice. but you have to change back to plasma to mess with settings...

Forum kindly sponsored by