From 505a8d255d822de41175963f7fc4fc48309aa5d1 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Sat, 21 Mar 2020 23:20:05 +0000 Subject: [PATCH] systemd: add & enable xsettingsd service Update `dpi` script to interact with systemd units --- .config/systemd/user/xsettingsd.service | 12 ++++++++++++ scripts/dpi | 12 +++++------- 2 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 .config/systemd/user/xsettingsd.service diff --git a/.config/systemd/user/xsettingsd.service b/.config/systemd/user/xsettingsd.service new file mode 100644 index 0000000..a547e88 --- /dev/null +++ b/.config/systemd/user/xsettingsd.service @@ -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 diff --git a/scripts/dpi b/scripts/dpi index 44868b6..8188331 100755 --- a/scripts/dpi +++ b/scripts/dpi @@ -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