Nicola Farina
27 discussion posts
Hi guys,
I have a bunch of triggers that I need to point to "second" screen I attached, but sometimes this is on left and other times on right. Using a laptop on docking stations and using it with external direct connected screens too, I need my triggers to point to which monitor is not the Windows main one.
With MoveToNext or MoveToPrevious I need to define the exact position, that for me can change.
How can I build a function to detect the ID of which I consider not the main Windows screen at the moment? I always use two screens at maximum, so I could be satifisfied using the first low value of an array (for example).
Thanks.
Is the laptop always monitor ID 1 in your setups?
Nicola Farina
27 discussion posts
No, because when on docking stations, I tipically don't use the laptop monitor (the lid is closed).
Examples:
- laptop only (obvious one-screen setup)
- laptop screen (sometimes on left, sometimes on right) + 1 external screen (Windows main)
- 2 externals (on the left is the Windows main) and no laptop screen (lid closed)
As you can see, the "first second" screen ID is what I looking for (but tell me if I'm wrong).
Many thanks.
Ok, interesting. Is the second monitor always a higher ID than the primary?
Nicola Farina
27 discussion posts
Need to check, I'll get back to you in few days.
Nicola Farina
27 discussion posts
Seems not.
Only laptop screen > main ID = 1
Docking with 2 ext screens and no laptop screen (lid closed) > main ID = 1 (left one)
1 ext screen plus laptop screen > main ID = 2 (ext one), laptop on left
Ideally, I need to determine the first screen that is not the main Windows one.
I suppose that can be helpful for some other folks here.
Thanks.
Ok, this would be possible with a Scripted Function. What we could do is write a Scripted Function that moves the Window to the "second" monitor, then runs your Custom Function for the size. If you think that would work, please let me know and I'll send over the Scripted Function.
Thanks!
Ok, try this one out! You'll need to import it on the Settings > Functions tab and set the name of your Custom Function at the top of the script. After that, apply the settings, then try adding it to your Trigger rule, hopefully it works for you!
Nicola Farina
27 discussion posts
Just to let you know that I'm starting testing today.
Thank you very much for your great support, as usual.
I'll back to you soon for a final feedback.
Nicola Farina
27 discussion posts
Keith I've an issue within this script using your seggested function (that works great). I've no idea why now it doesn't work.
When my second screen is smaller than main one (fullHD instead of 2K), the y positioning is wrong (see attachments).
The second screen (smaller) is using a different Windows scaling setting (120% instead of 100% of the main one), but I've tested with no luck.
Can you please help me?
Thanks!
• Attachment [protected]: DFS help.zip [14,757 bytes]
Nicola Farina
27 discussion posts
Uhmmm, it seems that "top position" is refered to the main screen height that is bigger then the destination monitor ones. Could be this?