Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Trying to get a cleaner dual monitor configuration
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
qweb.ric
n00b
n00b


Joined: 15 Jan 2015
Posts: 16

PostPosted: Sat Jan 09, 2021 8:21 pm    Post subject: Trying to get a cleaner dual monitor configuration Reply with quote

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.
Back to top
View user's profile Send private message
qweb.ric
n00b
n00b


Joined: 15 Jan 2015
Posts: 16

PostPosted: Tue Jan 12, 2021 4:53 pm    Post subject: Reply with quote

I ended up fixing the touchscreen and pen calibration issues by writing a bash script and setting it to run as a background process. The script monitors `xinput list`, and `kscreen-doctor -o` and recalibrates both pen and touchscreen appropriately. Seems to work a treat!

I've made this script available here in case anybody else finds it useful. Should be simple enough to modify for other systems:

https://github.com/qwebltd/Useful-scripts/blob/main/Bash%20scripts%20for%20Linux/touchscreen-calibration-magic.sh
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum