Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add options for scale and panning #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion screenconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')
Expand Down