Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to check XDG_CACHE_HOME

See original GitHub issue


I want to write a cache file to speed up later runs of the appimage. For this I want to check XDG_CACHE_HOME and have a fallback variable for when it is not set.

In bash the check would look like this:

 echo ${XDG_CACHE_HOME:-$HOME/.cache}

Documentation for this is here:

Setting that in the recipe results in wrong path descriptions.

        - /dev/:$APPDIR/dev
        GST_PLUGIN_SYSTEM_PATH_1_0: '${APPDIR}/usr/lib/@CMAKE_SYSTEM_PROCESSOR@-linux-gnu/gstreamer-1.0' 
        GST_REGISTRY: "${XDG_CACHE_HOME:-$HOME/.cache}/application/gstreamer-cache.bin"

That writes to /home/user/-/home/user/.cache/application/. Is there a way to have such a check or is it simply impossible?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

azubietacommented, May 12, 2022

This is now documented at

Closing the issue, please feel free to reopen if needed.

azubietacommented, Dec 9, 2021

Is there any documentation as to what helpers exist and what they do?

Sorry for that, right now the only documentation is the code. It would be great if someone could assist me on documenting them. These are the helpers available:

Read more comments on GitHub >

github_iconTop Results From Across the Web

XDG Base Directory - ArchWiki
Application Legacy Path Supported Since ALSA ~/.asoundrc 577df36 · 1.2.3 Android Studio ~/.AndroidStudioX.X Android Studio 4.1 Anki ~/Anki , ~/Documents/Anki
Read more >
XDG Base Directory Specification
$XDG_STATE_HOME defines the base directory relative to which user-specific state files should be stored. If $XDG_STATE_HOME is either not set or ...
Read more >
Declutter Your Home Directory With The XDG Base ... - YouTube
I noticed that my home directory was becoming an absolute mess recently I had so many files in it that shouldn't have been...
Read more >
xdg/ at master · adrg/xdg - GitHub
Go implementation of the XDG Base Directory Specification and XDG user directories ... XDG_CACHE_HOME, ~/.cache, ~/Library/Caches, $home/lib/cache.
Read more >
XDGBaseDirectorySpecification - Debian Wiki
The XDG Base Directory Specification (XDGBDS) defines four categories of so called DotFiles and the corresponding directories in a users ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found