vincentbernat.i3wm-configur.../bin/xsettingsd-setup
Vincent Bernat 01d65673ca xsettings: when using display port adapter, keep HiDPI settings too
In fact, we should detect we have some videoprojector and do that.
2016-04-17 19:07:04 +02:00

28 lines
943 B
Bash
Executable file

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