Defaults

From our survey of other simlar packages, we've seen a range of approaches. Trying to take the best of those, these are the defaults that BaseDirs.jl uses.

Base directories

Common NameEnvVarLinuxMacOSWindows (KnownPath)
User dataXDG_DATA_HOME~/.local/share~/Library/Application SupportRoamingAppData
System dataXDG_DATA_DIRS/usr/local/share, /usr/share/Library/Application SupportProgramData
User configXDG_CONFIG_HOME~/.config~/Library/Application SupportRoamingAppData
System configXDG_CONFIG_DIRS/etc/xdg/Library/Application SupportProgramData
StateXDG_STATE_HOME~/.local/state~/Library/Application SupportLocalAppData
User executablesXDG_BIN_HOME [binhome]~/.local/bin~/.local/bin or /opt/local/bin or /usr/local/bin~\bin or RoamingAppData\bin or AppData\bin or pwd()
CacheXDG_CACHE_HOME~/.cache~/Library/Caches/LocalAppData\cache
RuntimeXDG_RUNTIME_DIR/run/user/$UID~/Library/Application SupportLocalAppData

User directories

Common NameEnvVarLinux[xdguserdirs]MacOSWindows (KnownPath)
DesktopXDG_DESKTOP_DIR~/Desktop~/DesktopDesktop
DownloadXDG_DOWNLOAD_DIR~/Downloads~/DownloadsDownloads
DocumentsXDG_DOCUMENTS_DIR~/Documents~/DocumentsDocuments
ProjectsXDG_PROJECTS_DIR~/Projects~/Projects~\Projects[winproj]
MusicXDG_MUSIC_DIR~/Music~/MusicMusic
PicturesXDG_PICTURES_DIR~/Pictures~/PicturesPictures
VideosXDG_VIDEOS_DIR~/Videos~/MoviesVideos
TemplatesXDG_TEMPLATES_DIR~/Templates~/TemplatesTemplates
PublicXDG_PUBLICSHARE_DIR~/Public~/PublicPublic

Application directories

Application paths

An application path string (henceforth given by the App placeholder) is formatted according to the following bits of information:

  • Qualifier (only used on mac), which defaults to org
  • Organisation/Company, which defaults to julia
  • Application name, which must be provided.

The operating system specific application path is composed as follows:

SystemApplication path formatExample
Linux$Namecontraption
MacOS$Qualifier.$Organisation.$Namecom.ACME.contraption
Windows$Organisation\$NameACME\contraption

Application directory template

Common NameLinuxMacOSWindows
User data$(User data)/$App$(User data)/$App$(User data)\$App\data
System data$(System data)/$App$(System data)/$App$(System data)\$App\data
User config$(User config)/$App$(User config)/$App$(User config)\$App\config
System config$(System config)/$App$(System config)/$App$(System config)\$App\config
Cache$(Cache)/$App$(Cache)/$App$(Cache)\$App\cache
State$(State)/$App$(State)/$App$(State)\$App\state

Extra directories

Common nameLinuxMacOSWindows
Fonts$(User data)/fonts, ~/.fonts, $(System data)/fonts~/Library/Fonts, /Library/Fonts, /System/Library/Fonts, /Network/Library/FontsFonts
Applications$(User data)/applications, $(System data)/applications/ApplicationsPrograms, CommonPrograms
  • binhomeWhile XDG_BIN_HOME is not yet standard, it seems like the most likely name to be given to ~/.local/bin (see this issue), and I think it is worth having something rather than nothing.
  • xdguserdirsIn accordance with the xdg-user-dirs documentation, the system and user user-dirs.dirs files are checked before using the defaults.
  • winprojSince there is no known projects directory on windows, we use the Projects subdirectory of FOLDERID_Profile.