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
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

Project directories

Project paths

A project path string (henceforth given by the Project 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/Project name, which must be provided.

The operating system specific project path is composed as follows:

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

Project directory template

Common NameLinuxMacOSWindows
User data$(User data)/$Project$(User data)/$Project$(User data)\$Project\data
System data$(System data)/$Project$(System data)/$Project$(System data)\$Project\data
User config$(User config)/$Project$(User config)/$Project$(User config)\$Project\config
System config$(System config)/$Project$(System config)/$Project$(System config)\$Project\config
Cache$(Cache)/$Project$(Cache)/$Project$(Cache)\$Project\cache
State$(State)/$Project$(State)/$Project$(State)\$Project\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.