summary refs log blame commit diff stats
path: root/storage/getdir_unix.go
blob: 29bedbe14283d87711fd365159fad309820c612f (plain) (tree)




































                                                                         
# Compatible with ranger 1.6.0 through 1.7.*
#
# Replace your rifle.conf with this file to use xdg-open as your file opener.
# This is, of course, adaptable for use with any other file opener.
else = xdg-open "$1"

# You need an "editor" and "pager" in order to use certain functions in ranger:
label editor = "$EDITOR" -- "$@"
label pager  = "$PAGER" -- "$@"
an class="nx">cacheDir := SysDir() // Grus cache directory is cacheDir/grus. grusCacheDir := fmt.Sprintf("%s/%s", cacheDir, "grus") return grusCacheDir } // SysDir returns the system data directory, this is useful for unveil in // OpenBSD. func SysDir() string { cacheDir := os.Getenv("GRUS_DIR") if len(cacheDir) == 0 { cacheDir = os.Getenv("XDG_DATA_HOME") } if len(cacheDir) == 0 { cacheDir = fmt.Sprintf("%s/%s/%s", os.Getenv("HOME"), ".local", "share") } return cacheDir }