From 6845868db92b28ae05dbc8d81b3f84e18af729cb Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 18 Jul 2024 00:50:11 +0200 Subject: Update setres MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- xorg-xrandr/setres/__main__.py.gpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/xorg-xrandr/setres/__main__.py.gpp b/xorg-xrandr/setres/__main__.py.gpp index f794339..ad8cfcf 100755 --- a/xorg-xrandr/setres/__main__.py.gpp +++ b/xorg-xrandr/setres/__main__.py.gpp @@ -21,6 +21,7 @@ crt = t('crt', 'c') large = t('large', 'l') single = t('single', '1') pretend = t('pretend', 'P') +rotated = t('rotated', 'r') [screen] = get_setup() ok = False @@ -49,6 +50,10 @@ if hostname == 'zenith': sec_position = 'left' +elif hostname == 'hades': + embed = 'eDP1' + embed.want_mode = '1920x1280' + %%>hostname="$(hostname | tr '[A-Z]' '[a-z]')" %%>file="${HOME}/.dotfiles/.private/setres/${hostname}" %%>if test -r "${file}"; then @@ -146,6 +151,10 @@ if '-embed' in args: embed.connected = False +prime_output = None +sec_output = None +embed_output = None + ### Apply @@ -155,6 +164,7 @@ if prime is not None and prime.connected and sec is not None and sec.connected a ok = True output = Output(prime.name) + prime_output = output display.outputs.append(output) output.mode = prime.want_mode output.rate = prime.want_rate @@ -163,6 +173,7 @@ if prime is not None and prime.connected and sec is not None and sec.connected a output.relto = None output = Output(sec.name) + sec_output = output display.outputs.append(output) output.mode = sec.want_mode output.rate = sec.want_rate @@ -174,6 +185,7 @@ if prime is not None and prime.connected and sec is not None and sec.connected a output = Output(embed.name) display.outputs.append(output) if embed.want_mode == prime.want_mode: + embed_output = output output.mode = embed.want_mode output.rate = embed.want_rate output.primary = False @@ -189,6 +201,7 @@ elif prime is not None and prime.connected: ok = True output = Output(prime.name) + prime_output = output display.outputs.append(output) output.mode = prime.want_mode output.rate = prime.want_rate @@ -203,6 +216,7 @@ elif prime is not None and prime.connected: output = Output(embed.name) display.outputs.append(output) if embed.want_mode == prime.want_mode: + embed_output = output output.mode = embed.want_mode output.rate = embed.want_rate output.primary = False @@ -218,6 +232,7 @@ elif sec is not None and sec.connected: ok = True output = Output(sec.name) + prime_output = output display.outputs.append(output) output.mode = sec.want_mode output.rate = sec.want_rate @@ -232,6 +247,7 @@ elif sec is not None and sec.connected: output = Output(embed.name) display.outputs.append(output) if embed.want_mode == sec.want_mode: + embed_output = output output.mode = embed.want_mode output.rate = embed.want_rate output.primary = False @@ -251,6 +267,7 @@ else: ok = True output = Output(embed.name) + prime_output = output display.outputs.append(output) output.mode = embed.want_mode output.rate = embed.want_rate @@ -265,6 +282,7 @@ else: output = Output(sec.name) display.outputs.append(output) output.off = True + if ok: @@ -283,6 +301,9 @@ if ok: display.outputs.append(output) output.off = True + embed_output is not None: + embed_output.rotated = ('left' if rotated else 'normal') + ok = apply_setup(display) -- cgit v1.2.3-70-g09d2