xdg: moving from extra/ to basis/.
parent
19447e44a4
commit
73d430bfb9
|
@ -1,29 +1,29 @@
|
||||||
! Copyright (C) 2015 John Benediktsson
|
! Copyright (C) 2015 John Benediktsson
|
||||||
! See http://factorcode.org/license.txt for BSD license
|
! See http://factorcode.org/license.txt for BSD license
|
||||||
|
|
||||||
USING: environment sequences splitting ;
|
USING: environment memoize sequences splitting ;
|
||||||
|
|
||||||
IN: xdg
|
IN: xdg
|
||||||
|
|
||||||
! http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
! http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
||||||
|
|
||||||
: xdg-data-home ( -- path )
|
MEMO: xdg-data-home ( -- path )
|
||||||
"XDG_DATA_HOME" os-env [ "~/.local/share" ] when-empty ;
|
"XDG_DATA_HOME" os-env [ "~/.local/share" ] when-empty ;
|
||||||
|
|
||||||
: xdg-config-home ( -- path )
|
MEMO: xdg-config-home ( -- path )
|
||||||
"XDG_CONFIG_HOME" os-env [ "~/.config" ] when-empty ;
|
"XDG_CONFIG_HOME" os-env [ "~/.config" ] when-empty ;
|
||||||
|
|
||||||
: xdg-cache-home ( -- path )
|
MEMO: xdg-cache-home ( -- path )
|
||||||
"XDG_CACHE_HOME" os-env [ "~/.cache" ] when-empty ;
|
"XDG_CACHE_HOME" os-env [ "~/.cache" ] when-empty ;
|
||||||
|
|
||||||
: xdg-data-dirs ( -- paths )
|
MEMO: xdg-data-dirs ( -- paths )
|
||||||
"XDG_DATA_DIRS" os-env ":" split harvest
|
"XDG_DATA_DIRS" os-env ":" split harvest
|
||||||
[ { "/usr/local/share" "/usr/share" } ] when-empty ;
|
[ { "/usr/local/share" "/usr/share" } ] when-empty ;
|
||||||
|
|
||||||
: xdg-config-dirs ( -- paths )
|
MEMO: xdg-config-dirs ( -- paths )
|
||||||
"XDG_CONFIG_DIRS" os-env ":" split harvest
|
"XDG_CONFIG_DIRS" os-env ":" split harvest
|
||||||
[ { "/etc/xdg" } ] when-empty ;
|
[ { "/etc/xdg" } ] when-empty ;
|
||||||
|
|
||||||
: xdg-runtime-dir ( -- path/f )
|
MEMO: xdg-runtime-dir ( -- path/f )
|
||||||
"XDG_RUNTIME_DIR" os-env ;
|
"XDG_RUNTIME_DIR" os-env ;
|
||||||
! TODO: check runtime secure permissions
|
! TODO: check runtime secure permissions
|
Loading…
Reference in New Issue