From 1411929ead8399f7f8fe1ff9344de298d72bb498 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Wed, 29 Jan 2020 11:34:00 +0100 Subject: [PATCH] xsettings: fix DPI computation --- bin/xsettingsd-setup | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/xsettingsd-setup b/bin/xsettingsd-setup index de1c02d..d1089b0 100755 --- a/bin/xsettingsd-setup +++ b/bin/xsettingsd-setup @@ -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