diff --git a/neofetch b/neofetch index 122b55df7f6..b0018cf62a1 100755 --- a/neofetch +++ b/neofetch @@ -5205,10 +5205,11 @@ cache() { } get_cache_dir() { - case $os in - "Mac OS X"|"macOS") cache_dir="/Library/Caches" ;; - *) cache_dir="/tmp" ;; - esac + if [[ "$TMPDIR" ]]; then + cache_dir="$TMPDIR" + else + cache_dir="/tmp" + fi } kde_config_dir() { @@ -5763,8 +5764,7 @@ get_args() { "--gap") gap="$2" ;; "--clean") [[ -d "$thumbnail_dir" ]] && rm -rf "$thumbnail_dir" - rm -rf "/Library/Caches/neofetch/" - rm -rf "/tmp/neofetch/" + rm -rf "$cache_dir/neofetch/" exit ;; @@ -12971,6 +12971,7 @@ EOF main() { cache_uname get_os + get_cache_dir # Load default config. eval "$config" @@ -12993,7 +12994,6 @@ main() { } image_backend - get_cache_dir old_functions print_info dynamic_prompt