Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Detect multiple Screens #7

Closed
tionis opened this issue May 26, 2020 · 15 comments
Closed

Feature Request: Detect multiple Screens #7

tionis opened this issue May 26, 2020 · 15 comments
Labels
cross-platform Make a particular feature cross-platform enhancement New feature or request

Comments

@tionis
Copy link
Contributor

tionis commented May 26, 2020

A function to detect if there are multiple displays would be much appreciated. Maybe even the Orientation of these.

@littledivy
Copy link
Owner

@tionis This is something I would want to implement. It would be hard for me to implement this as I don't use multi-displays. Although, I think .screenSize should give the size of both the screens.
Could you try .screenSize in a multi display env?

@danbulant
Copy link

it returns the complete size - like if you made a screenshot of all screens at once at just got the size from it

@tionis
Copy link
Contributor Author

tionis commented May 27, 2020

I can verify this. This is also in line with the behaviour I experienced with other automation libraries

@danbulant
Copy link

I think that's just how it was made. You would probably need to implement a different approach per system as I think win and linux will have a different system (in linux, you could probably just read xrandr config, don't know about windows)

@littledivy
Copy link
Owner

Could you confirm moveMouse on a multi display env? (Try setting negative values)
It's hard for me to support dual screen as I don't use them. Any PR is appreciated :)

@danbulant
Copy link

moveMouse works correctly, there's no need for negative values since the position is always positive.
I'm on Debian if that matters

@littledivy
Copy link
Owner

Alright. So I guess there's no problem with Dual screens supporting autopilot. Just detecting it is an issue.

@littledivy littledivy added the enhancement New feature or request label May 27, 2020
@danbulant
Copy link

A nice think would be to have a method return array of screens (like with name, size etc)

@littledivy
Copy link
Owner

But we don't actually have a way to do that. The low level C libs used don't provide that information.

@danbulant
Copy link

I know you can get that info on linux from xrandr (this works almost on every distro)

@littledivy
Copy link
Owner

https://github.com/greshake/i3status-rust/blob/master/src/blocks/xrandr.rs

Yes! I think we could do something similar as here

@littledivy
Copy link
Owner

So I've used xrandr to get the number of monitors (in Linux).
For Win and Mac, It returns 1.

pilot.getMonitors();

This will be available in the next release.

@littledivy
Copy link
Owner

Here we go
https://github.com/divy-work/autopilot-deno/releases/tag/v0.0.8

@littledivy
Copy link
Owner

Now, the challenge is to make it cross-platform. Any suggestions and PRs are welcomed.

@littledivy littledivy added help wanted Extra attention is needed cross-platform Make a particular feature cross-platform labels Jun 1, 2020
@littledivy
Copy link
Owner

https://github.com/divy-work/autopilot-deno/releases/tag/v0.1.1 makes it cross-platform (hopefully). It's quite unstable and would require to cross-check from Windows and Mac users. Closing this issue as the feature is implemented

@littledivy littledivy removed the help wanted Extra attention is needed label Jun 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cross-platform Make a particular feature cross-platform enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants