install.fairie/home/.chezmoiscripts/universal/run_onchange_after_14-timeshift.tmpl

22 lines
726 B
Cheetah
Raw Normal View History

{{- if eq .host.distro.family "linux" -}}
#!/usr/bin/env bash
# timeshift.json hash: {{ include (joinPath .chezmoi.homeDir ".config" "timeshift" "timeshift.json") | sha256sum }}
{{ includeTemplate "universal/profile" }}
{{ includeTemplate "universal/logg" }}
if command -v timeshift > /dev/null; then
if [ -d /etc/timeshift ]; then
TIMESHIFT_CONFIG="${XDG_CONFIG_HOME}:-$HOME/.config}/timeshift/timeshift.json"
logg info "Copying $TIMESHIFT_CONFIG to /etc/timeshift/timeshift.json"
sudo cp -f "$TIMESHIFT_CONFIG" /etc/timeshift/timeshift.json
else
logg info '`/etc/timeshift` is not a directory'
fi
else
logg info 'The `timeshift` executable is not available'
fi
{{ end -}}