xsettings: fix DPI computation

This commit is contained in:
Vincent Bernat 2020-01-29 11:34:00 +01:00
parent 08fa9a63d0
commit 1411929ead

View file

@ -4,9 +4,9 @@ DISPLAY=${DISPLAY%.0}
# For information
xrandr --current \
| sed -n 's/^\([^ ]\)* connected.* \([0-9]*\)x.* \([0-9]*\)mm x .*/\1 \2 \3/p' \
| sed -n 's/^\([^ ]\{1,\}\)* connected.* \([0-9]\{1,\}\)x.* \([0-9]\{1,\}\)mm x .*/\1 \2 \3/p' \
| while read output pixels mm; do
dpi=$(($pixels * 25.4 / $mm))
dpi=$(($pixels * 254 / 10 / $mm))
echo "$output: $dpi DPI"
done