mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-06-26 03:38:33 +02:00
23 lines
726 B
Bash
Executable file
23 lines
726 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 primary.*/\1/p') in
|
|
zoro,eDP1) 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
|