Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use $XDG_CACHE_HOME if defined #355

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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