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 5a39c9c87d85e742f9344f73eb3639c00f11feac
parent 30abe38b1de9fa6f81859aa1d42463a780fc6f62
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Fri, 25 Sep 2020 14:01:57 +0200

mon: allow setting internal display pixel density as env var

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

diff --git a/.local/bin/mon b/.local/bin/mon @@ -1,7 +1,7 @@ #!/bin/sh -int_dpi=315 if [ -z "$INT" ]; then INT=eDP-1; fi +if [ -z "$INT_DPI" ]; then INT_DPI=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 "$INT_DPI" --fb "$res_int" \ --output "$INT" --mode "$res_int" --scale 1x1 \ --output "$EXT" --off } ext() { - xrandr --dpi "$int_dpi" --fb "$res_int" \ + xrandr --dpi "$INT_DPI" --fb "$res_int" \ --output "$INT" --off \ --output "$EXT" --mode "${res_ext}" \ --scale "${res_factor}x${res_factor}" \ @@ -48,7 +48,7 @@ ext() { } dual() { - xrandr --dpi "$int_dpi" \ + xrandr --dpi "$INT_DPI" \ --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}" \ @@ -58,7 +58,7 @@ dual() { } mirror() { - xrandr --dpi "$int_dpi" \ + 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 \ --output "$EXT" --mode "${res_ext}" \