[Linux] Add dpi setting for macbook air

This commit is contained in:
Ivan Malison 2016-11-14 06:10:26 -06:00
parent b97c83f6a6
commit 9d94a09b58
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8

View File

@ -1,13 +1,21 @@
#!/usr/bin/env sh #!/usr/bin/env sh
# Don't try to guess DPI. For a laptop, we don't want the same DPI as dpi="$1"
# for an external screen. Just hardcode stuff...
case $(hostname),$(xrandr --current | \
if [ -z $dpi ]; then
# 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 .*[0-9][0-9]*x[0-9][0-9]*+[0-9][0-9]*+[0-9][0-9]* .*/\1/p' | \ sed -n 's/\([^ ]*\) connected .*[0-9][0-9]*x[0-9][0-9]*+[0-9][0-9]*+[0-9][0-9]* .*/\1/p' | \
sort | tr '\n' ':') in sort | tr '\n' ':') in
# imalison-arch,DVI-D-0:HDMI-0:) dpi=144 ;; # imalison-arch,DVI-D-0:HDMI-0:) dpi=144 ;;
*) dpi=${1:-144} ;; imalison-uber-loaner,eDP1:) dpi=72 ;;
esac *) dpi=96 ;;
esac
fi
echo "Setting dpi to $dpi"
# Build xsettingsd.local # Build xsettingsd.local
cp ~/.xsettingsd ~/.xsettingsd.local cp ~/.xsettingsd ~/.xsettingsd.local
@ -22,4 +30,4 @@ else
fi fi
# # Also use xrdb for very old stuff (you know, LibreOffice) # # Also use xrdb for very old stuff (you know, LibreOffice)
# echo Xft.dpi: "$dpi" | xrdb -merge echo Xft.dpi: "$dpi" | xrdb -merge