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

Set screen position #28

Open
soundflix opened this issue Apr 19, 2023 · 6 comments
Open

Set screen position #28

soundflix opened this issue Apr 19, 2023 · 6 comments

Comments

@soundflix
Copy link

Setting screen positions would be a good addition. Or did I miss it?

@Alexandro1112
Copy link

What did you mean?

@soundflix
Copy link
Author

Set position and offset of multiple screens

@Alexandro1112
Copy link

Try this script:

import AppKit

# Получаем список всех экранов
screens = AppKit.NSScreen.screens()


screen = screens[0]
frame = screen.frame()

new_frame = AppKit.NSMakeRect(frame.origin.x + 100, frame.origin.y - 50, frame.size.width, frame.size.height)

screen.setFrame(new_frame)

@soundflix
Copy link
Author

Thanks for the script. I do mostly stuff in Swift.
NSScreen does not have a .setScreen(..) method?!
I think setting screen origins only works with Quartz services methods. I tried some things, but all settings vanish after user session ends (log-out or restart)

@Alexandro1112
Copy link

If you can change the screen position in the system preferences, I think it's also possible to set the position automatically.

@Alexandro1112
Copy link

I'm thinking about the IOKit framework. I even set the screen resolution using this framework. I think we need to figure out how to change the screen position using Iokit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants