commit 357ca45ed28fadb45acc5853fd2796d1cc1c7540
parent 18144660606314c5b49e3eec7b27546a00dd8757
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Fri, 25 Sep 2020 14:44:24 +0200
mon: allow individual scaling for width and height
Diffstat:
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/.local/bin/mon b/.local/bin/mon
@@ -24,7 +24,8 @@ find_res() {
if [ -n "$res_ext" ]; then
res_ext_x="${res_ext%x*}"
res_ext_y="${res_ext#*x}"
- res_factor="$(printf '%d/%d\n' "${res_int_x}" "${res_ext_x}" | bc -l)"
+ res_factor="$(printf '%d/%d\n' "${res_int_x}" "${res_ext_x}" | bc -l)x$(
+ printf '%d/%d\n' "${res_int_y}" "${res_ext_y}" | bc -l)"
fi
}
@@ -43,7 +44,7 @@ ext() {
xrandr --dpi "${DPI_INT}" --fb "$res_int" \
--output "${INT}" --off \
--output "${EXT}" --mode "${res_ext}" \
- --scale "${res_factor}x${res_factor}" \
+ --scale "${res_factor}" \
--panning "${res_int}"
}
@@ -60,7 +61,7 @@ dual() {
--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}" \
- --scale "${res_factor}x${res_factor}" \
+ --scale "${res_factor}" \
--pos "${res_int_x}x0" \
--panning "${res_int}+${res_int_x}+0"
}
@@ -70,7 +71,7 @@ mirror() {
--fb "${res_int}" \
--output "${INT}" --primary --mode "${res_int}" --scale 1x1 \
--output "${EXT}" --mode "${res_ext}" \
- --scale "${res_factor}x${res_factor}" \
+ --scale "${res_factor}" \
--pos "0x0"
}