diff --git a/res/figma-fonthelper-updater.service b/res/figma-fonthelper-updater.service index c4d1667..fc269f2 100644 --- a/res/figma-fonthelper-updater.service +++ b/res/figma-fonthelper-updater.service @@ -4,7 +4,7 @@ After=systemd-user-sessions.service [Service] Type=simple -ExecStart=/home/$(whoami)/.config/systemd/user/figma-fonthelper/updater.sh +ExecStart=${XDG_CONFIG_HOME}/figma-fonthelper/updater.sh ExecStop=/bin/bash -c "`which kill` -f -s SIGTERM `ps --no-headers -fC updater.sh | awk '{print $2}'`" Restart=on-failure diff --git a/res/figma-fonthelper.service b/res/figma-fonthelper.service index 63053d6..9771694 100644 --- a/res/figma-fonthelper.service +++ b/res/figma-fonthelper.service @@ -4,7 +4,7 @@ After=systemd-user-sessions.service [Service] Type=simple -ExecStart=/home/$(whoami)/.config/systemd/user/figma-fonthelper/fonthelper +ExecStart=${XDG_CONFIG_HOME}/figma-fonthelper/fonthelper ExecStop=/bin/bash -c '`which killall` fonthelper' Restart=on-failure diff --git a/res/install.sh b/res/install.sh index 7937a26..9cbd3d8 100755 --- a/res/install.sh +++ b/res/install.sh @@ -53,8 +53,8 @@ EOF mkdir -p $CONFIG_DIR/systemd/user pushd $CONFIG_DIR/systemd/user - tar xJOf /tmp/fonthelper.tar.xz ./figma-fonthelper.service > figma-fonthelper.service - tar xJOf /tmp/fonthelper.tar.xz ./figma-fonthelper-updater.service > figma-fonthelper-updater.service + tar xJOf /tmp/fonthelper.tar.xz ./figma-fonthelper.service | XDG_CONFIG_HOME=$DATA_DIR envsubst > figma-fonthelper.service + tar xJOf /tmp/fonthelper.tar.xz ./figma-fonthelper-updater.service | XDG_CONFIG_HOME=$DATA_DIR envsubst > figma-fonthelper-updater.service chmod 644 figma-fonthelper.service chmod 644 figma-fonthelper-updater.service @@ -68,8 +68,8 @@ EOF systemctl --user enable figma-fonthelper.service systemctl --user enable figma-fonthelper-updater.service - systemctl --user status figma-fonthelper.service - systemctl --user status figma-fonthelper-updater.service + systemctl --user -q status figma-fonthelper.service + systemctl --user -q status figma-fonthelper-updater.service rm -rf ./fonthelper.tar* }