mirror of
https://github.com/gryf/pyrandr.git
synced 2025-12-19 13:38:00 +01:00
Added python3 support
This commit is contained in:
24
README.rst
24
README.rst
@@ -7,9 +7,8 @@ simple as possible.
|
|||||||
Requirements
|
Requirements
|
||||||
------------
|
------------
|
||||||
|
|
||||||
``pyrandr`` doesn't require any other thing than python and ``xrandr`` command
|
``pyrandr`` doesn't require any other thing than Python (any version starting
|
||||||
line tool. Currently it is tested only on Python2.7, support for Python3 is
|
from Python 2.7) and ``xrandr`` command line tool.
|
||||||
coming.
|
|
||||||
|
|
||||||
Installation
|
Installation
|
||||||
------------
|
------------
|
||||||
@@ -25,7 +24,24 @@ Invocation is simple, executing the script:
|
|||||||
|
|
||||||
user@localhost $ pyrandr.py
|
user@localhost $ pyrandr.py
|
||||||
|
|
||||||
should list all mailable outputs for your display device(s)
|
should list all mailable outputs for your display device(s).
|
||||||
|
|
||||||
|
There is a mode for turning all displays at once called panic mode:
|
||||||
|
|
||||||
|
.. code:: shell-session
|
||||||
|
|
||||||
|
user@localhost $ pyrandr.py -a
|
||||||
|
|
||||||
|
And most interesting part is ability to turn on selected outputs side by side
|
||||||
|
in horizontal layout, for example:
|
||||||
|
|
||||||
|
.. code:: shell-session
|
||||||
|
|
||||||
|
user@localhost $ pyrandr.py -p VGA1 VGA2 VGA1
|
||||||
|
|
||||||
|
Will switch off all other outputs, but ``VGA1`` and ``VGA2``, and place those
|
||||||
|
outputs in order ``VGA1`` on the right of ``VGA2``. The option ``-p`` will set
|
||||||
|
``VGA1`` as the primary output.
|
||||||
|
|
||||||
Use ``--help`` to see all the other options:
|
Use ``--help`` to see all the other options:
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ class Organizer(object):
|
|||||||
|
|
||||||
in_output = False
|
in_output = False
|
||||||
|
|
||||||
for line in xrandr.split('\n'):
|
for line in xrandr.decode().split('\n'):
|
||||||
match = DISPLAY_RE.match(line)
|
match = DISPLAY_RE.match(line)
|
||||||
if match:
|
if match:
|
||||||
data = match.groupdict()
|
data = match.groupdict()
|
||||||
@@ -113,7 +113,7 @@ class Organizer(object):
|
|||||||
|
|
||||||
def output_list(self):
|
def output_list(self):
|
||||||
for name in sorted(self._outputs.keys()):
|
for name in sorted(self._outputs.keys()):
|
||||||
print self._outputs[name]
|
print(self._outputs[name])
|
||||||
|
|
||||||
def set_single(self, out_name):
|
def set_single(self, out_name):
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user