From 08024490add03ef0e2f0f2a00949dc1ec4af09f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Samuelsson?= Date: Mon, 29 Jan 2018 13:09:38 +0100 Subject: [PATCH 1/2] Add options for scale and panning --- screenconfig | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/screenconfig b/screenconfig index 1ff26f7..bc0315d 100755 --- a/screenconfig +++ b/screenconfig @@ -107,6 +107,14 @@ def activate_crtc(sc, edid, output): cmd.append('--auto') else: cmd.extend(('--mode', resolution)) + + scale = get_attr(sc, crtc, 'scale', '1x1') + cmd.extend(("--scale", scale)) + + panning = get_attr(sc, crtc, 'panning', False) + if(panning): + cmd.extend(("--panning", panning)) + position = get_attr(sc, crtc, 'position') if position: p_crtc = position.get('crtc') From 8d365c72326241a8cccb23f4b4eae9e98fef754d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Samuelsson?= Date: Tue, 30 Jan 2018 21:41:40 +0100 Subject: [PATCH 2/2] Let get_attr ensure that default entry from config file exists before using it. --- screenconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/screenconfig b/screenconfig index bc0315d..af7eaa9 100755 --- a/screenconfig +++ b/screenconfig @@ -47,7 +47,7 @@ def get_attr(sc, current, attr, default=None): res = default if attr in sc[current]: res = sc[current][attr] - elif DEFAULT in sc: + elif DEFAULT in sc and attr in sc[DEFAULT]: res = sc[DEFAULT].get(attr) # print('get_attr', current, attr, res) return res