summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/textconf33
-rw-r--r--examples/textconf.conf35
2 files changed, 43 insertions, 25 deletions
diff --git a/examples/textconf b/examples/textconf
index 258de91..265be1b 100644
--- a/examples/textconf
+++ b/examples/textconf
@@ -105,7 +105,9 @@ adjustments = []
monitors = []
crtc = None
screen = None
-bldev = None
+name = None
+edid = None
+bldev = 'none'
blmin = 0
@@ -244,7 +246,7 @@ def add_adjustments(adjsections, adjustments):
@param adjsections:list<list<(str, str)>> The sections
@param adjustments:list<(float, float)→void> The list to fill with adjustments
'''
- global location, points, adjustment_method_x, adjustment_method_tty, crtc, screen, bldev, blmin
+ global location, points, adjustment_method_x, adjustment_method_tty, crtc, screen, bldev, blmin, name, edid
for section in adjsections:
for (setting, value) in section:
(value, linear, cie, default) = parse_value(value)
@@ -258,8 +260,10 @@ def add_adjustments(adjsections, adjustments):
elif setting == 'crtc': crtc = value
elif setting == 'screen': screen = value
elif setting == 'card': screen = value
- elif setting == 'backlight-device': bldev = value
- elif setting == 'backlight-minimum': blmin = int(value[0])
+ elif setting == 'name': name = value
+ elif setting == 'edid': edid = value
+ elif setting == 'backlight-device': bldev = value # TODO support multiple
+ elif setting == 'backlight-minimum': blmin = int(value[0]) # TODO support multiple
elif setting == 'backlight':
def f(x):
global backlight_value
@@ -321,9 +325,11 @@ screen_list = None
for section in sections[adjustment_method]:
output_adjustments = []
- crtc, screen, bldev, blmin = None, None, None, 0
+ crtc, screen, name, edid, bldev, blmin = None, None, None, None, 'none', 0
add_adjustments([section], output_adjustments)
- if (screen_list is None) and ((crtc is None) or (screen is None)):
+ crtc_screen = (crtc is None) or (screen is None)
+ name_edid = (name is not None) or (edid is not None)
+ if (screen_list is None) and (crtc_screen or name_edid):
screen_list = list_screens(list_method)
if screen is None:
screen = list(range(len(screen_list)))
@@ -331,10 +337,17 @@ for section in sections[adjustment_method]:
screen = [int(s) for s in screen]
crtcs = {}
for s in screen:
+ crtcs[s] = []
if crtc is not None:
- crtcs[s] = [int(c) for c in crtc]
- else:
- crtcs[s] = list(range(screen_list[s].crtc_count))
+ crtcs[s] += [int(c) for c in crtc]
+ elif (name is None) and (edid is None):
+ crtcs[s] += list(range(screen_list[s].crtc_count))
+ if name is not None:
+ s = crtcs[s]
+ crtcs[s] += [(d.crtc for d in screen_list.find_by_name(n) if d.crtc not in s) for n in name]
+ if edid is not None:
+ s = crtcs[s]
+ crtcs[s] += [(d.crtc for d in screen_list.find_by_edid(e) if d.crtc not in s) for e in edid]
monitors.append((crtcs, screen, bldev, blmin, output_adjustments))
@@ -446,7 +459,7 @@ if 'PATH' in os.environ:
for p in path:
f = p + sep + 'adjbacklight'
if os.path.exists(f):
- if os.accsss(f, X_OK):
+ if os.access(f, os.X_OK):
adjbl = True
break
makebl = lambda dev, blmin : None if dev == 'none' else Backlight(dev, adjbacklight = adjbl, minimum = blmin)
diff --git a/examples/textconf.conf b/examples/textconf.conf
index 4dcee4c..c8ab86f 100644
--- a/examples/textconf.conf
+++ b/examples/textconf.conf
@@ -186,19 +186,21 @@ backlight-minimum = 0 ; (default)
; the computer needs to be restarted. This can used so
; that it does not happen.
+edid = 00ffffffffffff0010ac00504d5730372f0c01030e281e962b0cc9a057479b2712484ca44380a959a94f615971594559c28f31590101863d00c05100304040a013006c231100001e000000fd0030aa1e821d000a202020202020000000fc0044454c4c2050313133300a2020000000ff00364432353232424c3730574d0a00ea
+; The monitor's extended display identification data.
+
[randr] ; RandR specific information for monitor 0
-monitor=0 ; Include [monitor 0]
-crtc=0 ; CRTC 0
-screen=0 ; in screen 0
+monitor=0 ; Include [monitor 0]
+;crtc=0 ; CRTC 0
+;screen=0 ; in screen 0
+;name=DVI-0 ; The name of the connector as give by X RandR
[drm] ; DRM specific information for monitor 0
-monitor=0 ; Include [monitor 0]
-crtc=1 ; CRTC 1
-card=0 ; on graphics card 0
-
-; TODO it should be possible to use connector name
-; (method specific) and EDID (method independent)
+monitor=0 ; Include [monitor 0]
+;crtc=1 ; CRTC 1
+;card=0 ; on graphics card 0
+;name=DVII-0 ; The name of the connector as give Blueshift's DRM (not as given by Linux)
; Here begins monitor identification and specific
@@ -209,14 +211,17 @@ card=0 ; on graphics card 0
gamma = 1.10:1.16:1.10 default
backlight-device = none
backlight-minimum = 0
+edid = 00ffffffffffff0010ac005045413035320c01030e281e962b0cc9a057479b2712484ca44380a959a94f615971594559c28f31590101863d00c05100304040a013006c231100001e000000fd0030aa1e821d000a202020202020000000fc0044454c4c2050313133300a2020000000ff003644323532324339353041450a0039
[randr] ; RandR specific information for monitor 1
-monitor=1 ; Include [monitor 1]
-crtc=1 ; CRTC 1
-screen=0 ; in screen 0
+monitor=1 ; Include [monitor 1]
+;crtc=1 ; CRTC 1
+;screen=0 ; in screen 0
+;name=VGA-0 ; The name of the connector as give by X RandR
[drm] ; DRM specific information for monitor 1
-monitor=1 ; Include [monitor 1]
-crtc=0 ; CRTC 0
-card=0 ; on graphics card 0
+monitor=1 ; Include [monitor 1]
+;crtc=0 ; CRTC 0
+;card=0 ; on graphics card 0
+;name=VGA-0 ; The name of the connector as give Blueshift's DRM (not as given by Linux)