Skip to content

Commit

Permalink
Add Plan 9 paths
Browse files Browse the repository at this point in the history
  • Loading branch information
adrg committed Mar 3, 2021
1 parent 1f7450a commit 3167dc2
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions paths_plan9.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// +build plan9

package xdg

import (
"path/filepath"
)

func initBaseDirs(home string) {
homeLibDir := filepath.Join(home, "lib")
rootLibDir := "/lib"

// Initialize base directories.
baseDirs.dataHome = xdgPath(envDataHome, homeLibDir)
baseDirs.data = xdgPaths(envDataDirs, rootLibDir)
baseDirs.configHome = xdgPath(envConfigHome, homeLibDir)
baseDirs.config = xdgPaths(envConfigDirs, rootLibDir)
baseDirs.cacheHome = xdgPath(envCacheHome, filepath.Join(homeLibDir, "cache"))
baseDirs.runtime = xdgPath(envRuntimeDir, "/tmp")

// Initialize non-standard directories.
baseDirs.stateHome = xdgPath(envStateHome, filepath.Join(homeLibDir, "state"))

baseDirs.applications = []string{
filepath.Join(home, "bin"),
"/bin",
}

baseDirs.fonts = []string{
filepath.Join(homeLibDir, "font"),
"/lib/font",
}
}

func initUserDirs(home string) {
UserDirs.Desktop = xdgPath(envDesktopDir, filepath.Join(home, "desktop"))
UserDirs.Download = xdgPath(envDownloadDir, filepath.Join(home, "downloads"))
UserDirs.Documents = xdgPath(envDocumentsDir, filepath.Join(home, "documents"))
UserDirs.Music = xdgPath(envMusicDir, filepath.Join(home, "music"))
UserDirs.Pictures = xdgPath(envPicturesDir, filepath.Join(home, "pictures"))
UserDirs.Videos = xdgPath(envVideosDir, filepath.Join(home, "videos"))
UserDirs.Templates = xdgPath(envTemplatesDir, filepath.Join(home, "templates"))
UserDirs.PublicShare = xdgPath(envPublicShareDir, filepath.Join(home, "public"))
}

0 comments on commit 3167dc2

Please sign in to comment.