diff --git a/dotfiles/lib/bin/xsettingsd-setup b/dotfiles/lib/bin/xsettingsd-setup index 45622c71..86b591a8 100755 --- a/dotfiles/lib/bin/xsettingsd-setup +++ b/dotfiles/lib/bin/xsettingsd-setup @@ -1,13 +1,21 @@ #!/usr/bin/env sh -# 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' | \ - sort | tr '\n' ':') in - # imalison-arch,DVI-D-0:HDMI-0:) dpi=144 ;; - *) dpi=${1:-144} ;; -esac +dpi="$1" + + +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' | \ + sort | tr '\n' ':') in + # imalison-arch,DVI-D-0:HDMI-0:) dpi=144 ;; + imalison-uber-loaner,eDP1:) dpi=72 ;; + *) dpi=96 ;; + esac +fi + +echo "Setting dpi to $dpi" # Build xsettingsd.local cp ~/.xsettingsd ~/.xsettingsd.local @@ -22,4 +30,4 @@ else fi # # Also use xrdb for very old stuff (you know, LibreOffice) -# echo Xft.dpi: "$dpi" | xrdb -merge +echo Xft.dpi: "$dpi" | xrdb -merge