xsettingsd: compute best DPI value for each screen

This commit is contained in:
Vincent Bernat 2020-01-29 11:37:12 +01:00
parent 1411929ead
commit 1902a4f0b5

View file

@ -7,7 +7,8 @@ xrandr --current \
| sed -n 's/^\([^ ]\{1,\}\)* connected.* \([0-9]\{1,\}\)x.* \([0-9]\{1,\}\)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 | while read output pixels mm; do
dpi=$(($pixels * 254 / 10 / $mm)) dpi=$(($pixels * 254 / 10 / $mm))
echo "$output: $dpi DPI" rounded=$(((dpi + 24) / 48 * 48))
echo "$output: ${dpi}dpi (rounded to ${rounded}dpi)"
done done
# Don't try to guess DPI. For a laptop, we don't want the same DPI as # Don't try to guess DPI. For a laptop, we don't want the same DPI as