Created
June 16, 2019 15:20
-
-
Save coralmw/7cc7dc16160f02be9f06b64f133678a7 to your computer and use it in GitHub Desktop.
set connected monitor brightness.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
from plumbum import local | |
import argparse | |
parser = argparse.ArgumentParser(description='Set all connected monitor brightness.') | |
parser.add_argument("brightness", type=int, help="brightness percentage") | |
args = parser.parse_args() | |
ddcutil = local["/usr/local/bin/ddcutil"] | |
displays_output = ddcutil["detect"]() | |
# get all display id's | |
displays = [int(l.split(" ")[1]) for l in displays_output.split("\n") if l.startswith("Display")] | |
for i in displays: | |
ddcutil["-d"][i]["setvcp"]["10"][args.brightness]() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment