dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 18144660606314c5b49e3eec7b27546a00dd8757
parent f7c64614d0f2720e6f0a3210d0c0575472d69f46
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Fri, 25 Sep 2020 14:40:55 +0200

mon: fix external scaling for mirror mode

Diffstat:
M.local/bin/mon | 20++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/.local/bin/mon b/.local/bin/mon @@ -1,7 +1,7 @@ #!/bin/sh if [ -z "$INT" ]; then INT=eDP-1; fi -if [ -z "$INT_DPI" ]; then INT_DPI=315; fi +if [ -z "$DPI_INT" ]; then DPI_INT=315; fi if [ -z "$EXT" ]; then EXT=HDMI-1; fi res_from_xrandr() { @@ -34,13 +34,13 @@ die() { } int() { - xrandr --dpi "${INT_DPI}" --fb "${res_int}" \ + xrandr --dpi "${DPI_INT}" --fb "${res_int}" \ --output "${INT}" --mode "${res_int}" --scale 1x1 \ --output "${EXT}" --off } ext() { - xrandr --dpi "${INT_DPI}" --fb "$res_int" \ + xrandr --dpi "${DPI_INT}" --fb "$res_int" \ --output "${INT}" --off \ --output "${EXT}" --mode "${res_ext}" \ --scale "${res_factor}x${res_factor}" \ @@ -56,22 +56,22 @@ ext_native() { } dual() { - xrandr --dpi "${INT_DPI}" \ + xrandr --dpi "${DPI_INT}" \ --fb "$(printf '%d*2\n' "$res_int_x" | bc)x${res_int_y}" \ --output "${INT}" --primary --mode "${res_int}" --scale 1x1 \ --output "${EXT}" --mode "${res_ext}" \ - --pos "${res_int_x}x0" \ --scale "${res_factor}x${res_factor}" \ + --pos "${res_int_x}x0" \ --panning "${res_int}+${res_int_x}+0" } mirror() { - printf - xrandr --dpi "${INT_DPI}" \ - --fb "$(printf '%d+%d\n' "$res_int_x" "$res_ext_x" | bc)x${res_int_y}" \ - --output "${INT}" --auto --scale 1x1 \ + xrandr --dpi "${DPI_INT}" \ + --fb "${res_int}" \ + --output "${INT}" --primary --mode "${res_int}" --scale 1x1 \ --output "${EXT}" --mode "${res_ext}" \ - --same-as "${INT}" --scale "${res_factor}x${res_factor}" + --scale "${res_factor}x${res_factor}" \ + --pos "0x0" } find_res