From 1902a4f0b50aa12fb94a8c4ce5819f42a2236a6b Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Wed, 29 Jan 2020 11:37:12 +0100 Subject: [PATCH] xsettingsd: compute best DPI value for each screen --- bin/xsettingsd-setup | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/xsettingsd-setup b/bin/xsettingsd-setup index d1089b0..4c9c7ef 100755 --- a/bin/xsettingsd-setup +++ b/bin/xsettingsd-setup @@ -7,7 +7,8 @@ xrandr --current \ | 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 * 254 / 10 / $mm)) - echo "$output: $dpi DPI" + rounded=$(((dpi + 24) / 48 * 48)) + echo "$output: ${dpi}dpi (rounded to ${rounded}dpi)" done # Don't try to guess DPI. For a laptop, we don't want the same DPI as