Merge branch 'master' of github.com:IvanMalison/dotfiles

This commit is contained in:
Ivan Malison 2016-11-13 14:31:46 +00:00
commit 1320c59a6c
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8

View File

@ -0,0 +1,25 @@
#!/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
# Build xsettingsd.local
cp ~/.xsettingsd ~/.xsettingsd.local
echo Xft/DPI $(( $dpi * 1024 )) >> ~/.xsettingsd.local
# Signal xsettingsd
pid=$(xprop -name xsettingsd _NET_WM_PID 2> /dev/null | awk '{print $NF}')
if [ x"$pid" = x ]; then
xsettingsd -c ~/.xsettingsd.local &
else
kill -HUP $pid
fi
# # Also use xrdb for very old stuff (you know, LibreOffice)
# echo Xft.dpi: "$dpi" | xrdb -merge