ptgdp: Fix multiple instances sharing a tmpfile

This commit is contained in:
Salt 2019-07-23 14:08:55 -05:00
parent 2afe7c9096
commit 107937bb41

2
ptgdp
View File

@ -13,7 +13,7 @@
# Variables
_name="$(basename -- "$0")"
_tmpdir="${XDG_CACHE_HOME:-$HOME/.cache}/$_name"
_tmpfile="$_tmpdir/tmpfile"
_tmpfile="$_tmpdir/tmpfile-$(cat /dev/urandom | tr -cd 'a-f0-9' | head -c 12)"
_xdguserdirs="${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs"
[ -f "$_xdguserdirs" ] && source "$_xdguserdirs"
_musicdir="${XDG_DATA_HOME:-$HOME/.local/share}/$_name"