Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
7 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
! Copyright (C) 2015 John Benediktsson | ||
! See http://factorcode.org/license.txt for BSD license | ||
|
||
USING: environment memoize sequences splitting ; | ||
USING: environment sequences splitting ; | ||
|
||
IN: xdg | ||
|
||
! http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html | ||
|
||
MEMO: xdg-data-home ( -- path ) | ||
: xdg-data-home ( -- path ) | ||
"XDG_DATA_HOME" os-env [ "~/.local/share" ] when-empty ; | ||
|
||
MEMO: xdg-config-home ( -- path ) | ||
: xdg-config-home ( -- path ) | ||
"XDG_CONFIG_HOME" os-env [ "~/.config" ] when-empty ; | ||
|
||
MEMO: xdg-cache-home ( -- path ) | ||
: xdg-cache-home ( -- path ) | ||
"XDG_CACHE_HOME" os-env [ "~/.cache" ] when-empty ; | ||
|
||
MEMO: xdg-data-dirs ( -- paths ) | ||
: xdg-data-dirs ( -- paths ) | ||
"XDG_DATA_DIRS" os-env ":" split harvest | ||
[ { "/usr/local/share" "/usr/share" } ] when-empty ; | ||
|
||
MEMO: xdg-config-dirs ( -- paths ) | ||
: xdg-config-dirs ( -- paths ) | ||
"XDG_CONFIG_DIRS" os-env ":" split harvest | ||
[ { "/etc/xdg" } ] when-empty ; | ||
|
||
MEMO: xdg-runtime-dir ( -- path/f ) | ||
: xdg-runtime-dir ( -- path/f ) | ||
"XDG_RUNTIME_DIR" os-env ; | ||
! TODO: check runtime secure permissions |