From b0d555ff98d80cb3265d716870f6534c133aaeaf Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Thu, 23 Jul 2015 21:42:32 +0200 Subject: [PATCH] xsettings: just hard-code appropriate DPI settings --- bin/xsettingsd-setup | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/bin/xsettingsd-setup b/bin/xsettingsd-setup index 8519584..8a6aa91 100755 --- a/bin/xsettingsd-setup +++ b/bin/xsettingsd-setup @@ -1,17 +1,11 @@ #!/bin/sh -# Compute DPI. We extract the value from xrandr output. The screen -# size is correctly reported (while the X server is lying to respect -# the provided DPI). We round to the nearest quarter of 96 DPI (96, -# 120, 144, 168, 192...). -eval $(xrandr --current | sed -n 's/.* connected primary \([0-9]*\)x.* \([0-9]*\)mm x .*/wd=\1\nwm=\2/p') -if [ -n "$wd" -a -n "$wm" ]; then - dpi=$(echo "$wd/($wm*0.03937)" | bc) - dpi=$(printf "%.0f" $(echo "scale=1;$dpi*4/96" | bc)) - dpi=$((dpi*96/4)) -else - dpi=96 -fi +# 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),$(xrandr --current | sed -n 's/\([^ ]*\) connected primary.*/\1/p') in + zoro,eDP1) dpi=144 ;; + *) dpi=96 ;; +esac # Build xsettingsd.local cp ~/.config/awesome/xsettingsd ~/.config/awesome/xsettingsd.local