tmp: Use XDG spec for Templates dir
This commit is contained in:
parent
d0f8eda505
commit
6637e750c9
9
tmp
9
tmp
@ -52,13 +52,20 @@ done
|
||||
|
||||
# Copy in template directory
|
||||
if [ -n "$1" ]; then
|
||||
copydir="$HOME/Templates/tmp/$1"
|
||||
# Source in XDG dirs, if they exist
|
||||
userdirs="${XDG_CONFIG_HOME:-~/.config}/user-dirs.dirs"
|
||||
if [ -f "$userdirs" ]; then
|
||||
source "$userdirs"
|
||||
fi
|
||||
unset userdirs
|
||||
copydir="${XDG_TEMPLATES_DIR:-~/Templates}/tmp/$1"
|
||||
if [ -d "$copydir" ]; then
|
||||
log "Using template \"$1\""
|
||||
cp -r "$copydir"/* "$tmpdir"
|
||||
else
|
||||
log "Could not find template directory \"$copydir\""
|
||||
fi
|
||||
unset copydir
|
||||
fi
|
||||
|
||||
trap "cleanup" EXIT
|
||||
|
Loading…
Reference in New Issue
Block a user