Giter VIP home page Giter VIP logo

Comments (3)

zappybiby avatar zappybiby commented on August 18, 2024 1

We could use screeninfo which supports Windows/OSX/Linux if additional requirements are obtained (PyOBJus for OSX and Xinerama for Linux)

from eurotruckautopilot.

ajchili avatar ajchili commented on August 18, 2024

Program arguments could be used for monitor number and resolution (i.ie -m 2 -r 1920). This would be a lazy or simple approach to it. I don't know how much time I will have to help look into this but any resources for this should be placed here @zappybiby.

from eurotruckautopilot.

zappybiby avatar zappybiby commented on August 18, 2024

For someone with two monitors, using the code

from screeninfo import get_monitors
for m in get_monitors():
    print(str(m))

will return

monitor(1920x1080+1920+0)
monitor(1920x1080+0+0)

Knowing this, we can return the number of monitors and monitor size with the following code:

from screeninfo import get_monitors
import re

for m in get_monitors():
    x = (str(m))
    print("number of monitors:", x.count("monitor"))
    y = re.sub(r'monitor', '', x)
    print(y)

which will return this on a computer with one monitor

number of monitors: 1
(1100x655+0+0)

Not sure how to get rid of parentheses and we would have to interpret this string somehow. Note that screeninfo does not comma separate different monitors but just puts each of them on a new line.

from eurotruckautopilot.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.