Skip to content

Commit

Permalink
MACOS: Added brightness(), setBrightnes(), setOrientation() thru disp…
Browse files Browse the repository at this point in the history
…lay_manager_lib (thanks to University of Utah - Marriott Library - Apple Infrastructure)

WIN32: Fixed setScale()
  • Loading branch information
Kalmat committed Aug 23, 2023
1 parent bbf5e36 commit 4aade85
Show file tree
Hide file tree
Showing 10 changed files with 822 additions and 54 deletions.
1 change: 1 addition & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
PyMonCtl authors, contributors and maintainers:

Kalmat https://github.com/Kalmat
University of Utah - Marriott Library - Apple Infrastructure https://github.com/univ-of-utah-marriott-library-apple
5 changes: 5 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
0.0.11, 2023/08/23 -- MACOS: Added display_manager_lib (thanks to University of Utah - Marriott Library - Apple Infrastructure)
WIN32: Fixed setScale()
0.0.10, 2023/08/21 -- ALL: Fixed watchdog thread
LINUX: Added attach()/detach(), fixed setPosition() and arrangeMonitors()
WIN32: Fixed and improved many issues (scale still pending)
0.0.9, 2023/07/19 -- New approach based on Monitor() class to access all properties and functionalities (macOS pending)
0.0.8, 2023/05/12 -- Pre-release tested OK in Linux/X11 (not Wayland) and win32 (macOS pending)
14 changes: 14 additions & 0 deletions DISPLAY_MANAGER_LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
########################################################################
# Copyright (c) 2018 University of Utah Student Computing Labs. #
# All Rights Reserved. #
# #
# Permission to use, copy, modify, and distribute this software and #
# its documentation for any purpose and without fee is hereby granted, #
# provided that the above copyright notice appears in all copies and #
# that both that copyright notice and this permission notice appear #
# in supporting documentation, and that the name of The University #
# of Utah not be used in advertising or publicity pertaining to #
# distribution of the software without specific, written prior #
# permission. This software is supplied as is without expressed or #
# implied warranties of any kind. #
########################################################################
4 changes: 3 additions & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


81 changes: 42 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

Cross-Platform module which provides a set of features to get info on and control monitors.

#### My most sincere thanks and appreciation to the University of Utah Student Computing Labs for their awesome work on the display_manager_lib module, for sharing it so generously, and most especially for allowing to be integrated into PyMonCtl

## General Functions

Expand Down Expand Up @@ -31,48 +32,50 @@ getPrimary() or findMonitor(x, y).
To instantiate it, you need to pass the monitor handle (OS-dependent). It can raise ValueError exception in case
the provided handle is not valid.

| | Windows | Linux | macOS |
|:--------------:|:-------:|:-----:|:-----:|
| size | X | X | X |
| workarea | X | X | X |
| position | X | X | X |
| setPosition | X | X | X |
| box | X | X | X |
| rect | X | X | X |
| scale | X | X | X |
| setScale | X | X | X |
| dpi | X | X | X |
| orientation | X | X | X |
| setOrientation | X | X | |
| frequency | X | X | X |
| colordepth | X | X | X |
| brightness | X (1) | X | |
| setBrightness | X (1) | X | |
| contrast | X (1) | X | |
| setContrast | X (1) | X | |
| mode | X | X | X |
| setMode | X | X | X |
| defaultMode | X | X | X |
| setDefaultMode | X | X | X |
| allModes | X | X | X |
| isPrimary | X | X | X |
| setPrimary | X | X | X |
| turnOn | X | X | |
| turnOff | X (2) | X | |
| suspend | X (2) | X (3) | X (3) |
| isOn | X | X | |
| attach | X | X | |
| detach | X | X | |
| isAttached | X | X | X |


(1) If monitor has no VCP MCCS support, these methods won't likely work.

(2) If monitor has no VCP MCCS support, it can not be addressed separately,
| | Windows | Linux | macOS |
|:--------------:|:-------:|:------:|:-----:|
| size | X | X | X |
| workarea | X | X | X |
| position | X | X | X |
| setPosition | X | X | X |
| box | X | X | X |
| rect | X | X | X |
| scale | X | X | X |
| setScale | X | X | X |
| dpi | X | X | X |
| orientation | X | X | X |
| setOrientation | X | X | X (1) |
| frequency | X | X | X |
| colordepth | X | X | X |
| brightness | X (2) | X | X (1) |
| setBrightness | X (2) | X | X (1) |
| contrast | X (2) | X | |
| setContrast | X (2) | X | |
| mode | X | X | X |
| setMode | X | X | X |
| defaultMode | X | X | X |
| setDefaultMode | X | X | X |
| allModes | X | X | X |
| isPrimary | X | X | X |
| setPrimary | X | X | X |
| turnOn | X | X | |
| turnOff | X (3) | X | |
| suspend | X (3) | X (4) | X (4) |
| isOn | X | X | |
| attach | X | X | |
| detach | X | X | |
| isAttached | X | X | X |


(1) Thru display_manager_lib from University of Utah - Marriott Library - Apple Infrastructure (thank you, guys!)

(2) If monitor has no VCP MCCS support, these methods won't likely work.

(3) If monitor has no VCP MCCS support, it can not be addressed separately,
so ALL monitors will be turned off / suspended.
To address a specific monitor, try using detach() / attach() methods.

(3) It will suspend ALL monitors.
(4) It will suspend ALL monitors.


#### WARNING: Most of these properties may return ''None'' in case the value can not be obtained
Expand Down
1 change: 0 additions & 1 deletion TODO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ WINDOWS
- Find a solution for changing scale

MACOS
- Contact display-manager-lib team to check alternatives or find another solution (for setOrientation, brightness)
- Test everything in an actual macOS installation with a multi-monitor setup
- Check returned coordinates (multi-monitor, flipped, ...)
- Find a way to turn monitor OFF/ON/SUSPEND/WAKEUP/DETACH/ATTACH
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion src/pymonctl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"getMousePos", "version", "Monitor"
]

__version__ = "0.0.10"
__version__ = "0.0.11"


def version(numberOnly: bool = True) -> str:
Expand Down
Loading

0 comments on commit 4aade85

Please sign in to comment.