qweb.ric n00b
Joined: 15 Jan 2015 Posts: 29
|
Posted: Sat Jan 09, 2021 8:21 pm Post subject: Trying to get a cleaner dual monitor configuration |
|
|
I have an Asus UX563F which has a second screen under the touchpad. The main screen is a touchscreen, and the laptop is a flip so folding the screen back far enough triggers tablet mode basically... disabling the keyboard, touchpad, and secondary screen via an ACPI power event.
Everything mostly works but there are a couple of niggly things because of this being a secondary screen. I'm running KDE Plasma 5 and of course, Gentoo.
- I have my desktop icons on the second screen because it's actually really handy to have those on view all of the time while apps are full screen on the main screen device. But because the secondary screen is disconnected and reconnected every time I restart, close the lid, or fold the lid far enough back to enter tablet mode, the icons keep moving back to a default position on the first row. There's a KDE bug report about this but it's been open for over 4 years now... any advice on a workaround would be appreciated. https://bugs.kde.org/show_bug.cgi?id=385824
- The touchscreen calibration defaults to the full screen area, i.e. the combined hieght of both screens instead of just the main screen that I'm actually touching. I can fix this with "xinput map-to-output 12 eDP-1", where 12 is the ID of my touchscreen device as per "xinput list" but again I need to do this every time I restart, close the lid, or flip the lid back/forward because the second screen is reconnected and caliration messes up.
- This laptop also comes with a pen which suffers the same problem as with the touchscreen - calibration messing up on these lid / restart events. Again I can fix with an xinput call.
Those last two issues are what I'm here for really. I'd like to set up scripts to trigger the xinput commands when these events fire, but I'm struggling...
Firstly I realise I can add a script to /etc/X11/xinit/xinitrc.d/ and this should fire when X starts, but it doesn't help with firing when the second screen connects/disconnects and I think that's what I need really. Flipping the lid back for example and entering tablet mode doesn't seem to invoke this script.
Secondly, the pen device shows up in xinput list as "ELAN9008:00 04F3:2A46 Pen (0)" but only after I've tried to use it. It's not a device before then, which makes sense of course, but if I do a map-to-output while it isn't a recognised device, the script will error out.
Thirdly, the main touchscreen device shows up in xinput as "ELAN9008:00 04F3:2A46" under the Virtual Core Pointer section, but there's another device under Virtual Core Keyboard with exactly the same name (same controller I assume) so I can't reference by name with the map-to-output call. Instead I have to reference by ID, and that's going to keep changing I expect? In which case running the script on any kind of automated event poses the problem that it might map the wrong device if I reference by ID, but fails if I try to reference the name. Is there perhaps a way I can reference the virtual core pointer section AND the name?
Any advice at all would be appreciated please. |
|