xsettingsd: compute DPI for each screen

We don't use the information yet.
This commit is contained in:
Vincent Bernat 2020-01-29 04:59:12 +01:00
parent 2511f41461
commit 2fa5ff7a38

View file

@ -2,6 +2,14 @@
DISPLAY=${DISPLAY%.0}
# For information
xrandr \
| sed -n 's/^\([^ ]\)* connected.* \([0-9]*\)x.* \([0-9]*\)mm x .*/\1 \2 \3/p' \
| while read output pixels mm; do
dpi=$(($pixels * 25.4 / $mm))
echo "$output: $dpi DPI"
done
# Don't try to guess DPI. For a laptop, we don't want the same DPI as
# for an external screen. Just hardcode stuff...
case $(hostname),$(autorandr --current) in