ltk

Module dirs

Source
Expand description

The user’s folders: XDG’s on Linux, the profile’s on Windows. An app keeps its files in a folder of its own under one of these, named after itself.

FunctionLinuxWindows
homeHOMEUSERPROFILE
data_homeXDG_DATA_HOME, else ~/.local/shareAPPDATA, roaming with the user
config_homeXDG_CONFIG_HOME, else ~/.configAPPDATA
cache_homeXDG_CACHE_HOME, else ~/.cacheLOCALAPPDATA, kept on this machine
state_homeXDG_STATE_HOME, else ~/.local/stateLOCALAPPDATA

An XDG_* variable that is set wins on Windows too. Each is None when neither the variable nor what it falls back to is set.

Functions§

  • Where what can be rebuilt goes, such as downloaded pages or thumbnails.
  • Where the user’s settings go.
  • Where the user’s own data goes, such as bookmarks or history.
  • The user’s home folder: HOME, or on Windows, where it is seldom set, USERPROFILE.
  • Where state that should outlive a run but not follow the user goes, such as logs or a window’s last place.