Skip to content

Commit

Permalink
Use $XDG_CACHE_HOME if defined (#355)
Browse files Browse the repository at this point in the history
  • Loading branch information
Samueru-sama authored Nov 28, 2024
1 parent 1462905 commit 4205ed2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions usr/bin/hypnotix
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/bin/sh

mkdir -p ~/.cache/hypnotix/favorites
touch ~/.cache/hypnotix/favorites/list
CACHEDIR="${XDG_CACHE_HOME:-$HOME/.cache}"
mkdir -p "${CACHEDIR}"/hypnotix/favorites
touch "${CACHEDIR}"/hypnotix/favorites/list

mkdir -p ~/.cache/hypnotix/yt-dlp
mkdir -p "${CACHEDIR}"/hypnotix/yt-dlp
if [ $(gsettings get org.x.hypnotix use-local-ytdlp) = true ]
then
echo "Local version of yt-dlp selected."
export PATH="${HOME}/.cache/hypnotix/yt-dlp":${PATH}
export PATH="${CACHEDIR}/hypnotix/yt-dlp:${PATH}"
else
echo "System version of yt-dlp selected."
fi
Expand Down

0 comments on commit 4205ed2

Please sign in to comment.