1
0
mirror of https://github.com/frebib/dotfiles.git synced 2024-06-14 12:57:23 +00:00

systemd: add & enable xsettingsd service

Update `dpi` script to interact with systemd units
This commit is contained in:
Joe Groocock 2020-03-21 23:20:05 +00:00
parent bbfb8fff3f
commit 505a8d255d
Signed by: frebib
GPG Key ID: E0B16BEACFBB6A86
2 changed files with 17 additions and 7 deletions

View File

@ -0,0 +1,12 @@
[Unit]
Description=xsettingsd - provide settings to X11 applications
Requires=xorg.target
After=xorg.target profile.service
[Service]
ExecStart=/bin/sh -c 'xsettingsd -c $XDG_CONFIG_HOME/xsettingsd/xsettingsd.local'
ExecReload=/bin/kill -s HUP $MAINPID
Restart=always
[Install]
WantedBy=graphical-session.target

View File

@ -21,11 +21,9 @@ mkdir -p "$CONF_DIR"
echo Gdk/UnscaledDPI $(( $dpi*1024/($dpi/96) ))
} > $CONF_DIR/xsettingsd.local
pid=$(xprop -name xsettingsd _NET_WM_PID 2> /dev/null | awk '{print $NF}')
if [ -z "$pid" ]; then
xsettingsd -c $CONF_DIR/xsettingsd.local &
else
kill -HUP $pid
fi
echo Xft.dpi: $dpi | xrdb -merge
xrandr --dpi $dpi
systemctl --user reload-or-restart xsettingsd
systemctl --user --no-block reload i3
systemctl --user --no-block restart polybar@i3bar dunst