From 481068376348b3c645b1992100e891a5fd17eacc Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 4 Jun 2025 22:46:25 +0300 Subject: [PATCH] Read standard XDG directories via systemd --- .local/bin/make-backup | 8 ++++---- .local/bin/package-alert | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.local/bin/make-backup b/.local/bin/make-backup index b18bb88..9e80167 100755 --- a/.local/bin/make-backup +++ b/.local/bin/make-backup @@ -3,7 +3,7 @@ export BORG_REPO="/media/backup/" export BORG_PASSCOMMAND="cat ${HOME}/.keys/borg-passphrase.txt" -TS_DIR="${HOME}/.local/state/backup" +TS_DIR="$(systemd-path user-state-private)"/backup mkdir -p "${TS_DIR}" @@ -11,12 +11,12 @@ backup () { target=$1 directory=$2 - if "${HOME}/.local/bin/dirtree-changed" --directory "${directory}" --check-file "${TS_DIR}/${target}" + if "$(systemd-path user-binaries)"/dirtree-changed --directory "${directory}" --check-file "${TS_DIR}/${target}" then borg create --compression auto,lzma ::"${target}"-\{now\} "${directory}" touch "${TS_DIR}/${target}" fi } -backup circuits "${HOME}/.config/circuits" -backup documents "${HOME}/Documents" +backup circuits "$(systemd-path user-configuration)"/circuits +backup documents "$(systemd-path user-documents)" diff --git a/.local/bin/package-alert b/.local/bin/package-alert index dee9127..1bce7c2 100755 --- a/.local/bin/package-alert +++ b/.local/bin/package-alert @@ -1,6 +1,6 @@ #! /usr/bin/sh -WATCHLIST=~/.local/share/package-alert/watchlist +WATCHLIST="$(systemd-path user-shared)"/package-alert/watchlist agg_results=""