vincentbernat.i3wm-configur.../bin/xsettingsd-setup
Vincent Bernat 2452fb6bcb xsettingsd: remove extra .0 awesome puts at the end of DISPLAY
Awesome likes to use :0.0 for DISPLAY because it thinks we are using
Zaphod and not Xinerama.
2020-01-22 22:34:28 +01:00

29 lines
883 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),$(autorandr --current --skip-options gamma) in
zoro,default) dpi=144 ;;
guybrush,default) dpi=144 ;;
neo,*) dpi=192 ;;
*,*) dpi=96 ;;
esac
change() {
# Build xsettingsd.local
{
cat ~/.config/awesome/xsettingsd
echo Xft/DPI $(( $1*1024 ))
echo Xft/RGBA \"$( [ $1 -gt 144 ] && echo none || echo rgb )\"
echo Gdk/WindowScalingFactor $(( $1/96 ))
echo Gdk/UnscaledDPI $(( $1*1024/($1/96) ))
} > ~/.xsettingsd
# Signal xsettingsd
systemctl --user reload xsettingsd@$(systemd-escape -- "${DISPLAY%.0}").service
# Also use xrdb for very old stuff (you know, LibreOffice)
echo Xft.dpi: $dpi | xrdb -merge
}
change $dpi