2018-11-20 15:06:09 +00:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Based on https://github.com/vincentbernat/awesome-configuration/blob/master/bin/xsettingsd-setup
|
|
|
|
|
|
|
|
dpi=$1
|
|
|
|
|
|
|
|
if [ -z "$1" ]; then
|
|
|
|
>&2 printf "Usage\n\t%s: <dpi>" "$(basename "$0")"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
CONF_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/xsettingsd"
|
2018-11-20 15:39:26 +00:00
|
|
|
mkdir -p "$CONF_DIR"
|
2018-11-20 15:06:09 +00:00
|
|
|
|
|
|
|
# Build xsettingsd.local
|
|
|
|
{
|
|
|
|
cat $CONF_DIR/xsettingsd.conf 2>/dev/null || true
|
|
|
|
echo Xft/DPI $(( $dpi*1024 ))
|
|
|
|
echo Gdk/WindowScalingFactor $(( $dpi/96 ))
|
|
|
|
echo Gdk/UnscaledDPI $(( $dpi*1024/($dpi/96) ))
|
|
|
|
} > $CONF_DIR/xsettingsd.local
|
|
|
|
|
|
|
|
echo Xft.dpi: $dpi | xrdb -merge
|
2020-03-21 23:20:05 +00:00
|
|
|
xrandr --dpi $dpi
|
|
|
|
|
|
|
|
systemctl --user reload-or-restart xsettingsd
|
|
|
|
systemctl --user --no-block reload i3
|
|
|
|
systemctl --user --no-block restart polybar@i3bar dunst
|