Browse Source

Try to be more conformant with XDG standards

First attempt to base saturnin paths on XDG paths.
Alois Mahdal 7 years ago
parent
commit
01607f9683
2 changed files with 13 additions and 5 deletions
  1. 7
    2
      mkit.ini
  2. 6
    3
      src/bin/app.skel

+ 7
- 2
mkit.ini View File

20
 
20
 
21
 [ENV]
21
 [ENV]
22
     PREFIX = /usr/local
22
     PREFIX = /usr/local
23
+    XDG_DATA_HOME = $HOME/.local/share
24
+    XDG_CACHE_HOME = $HOME/.cache
25
+    XDG_CONFIG_HOME = $HOME/.config
23
 
26
 
24
 [roots]
27
 [roots]
25
     bin     = [ENV:PREFIX]/bin
28
     bin     = [ENV:PREFIX]/bin
30
     etc_bc  = /etc/bash_completion.d
33
     etc_bc  = /etc/bash_completion.d
31
 
34
 
32
 [tokens]
35
 [tokens]
33
-    __SATURNIN_CACHE_HOME__     = $HOME/.cache/saturnin-demo
34
-    __SATURNIN_CONFIG_USER__    = $HOME/.saturnin-demo
36
+    __SATURNIN_DATA_HOME__      = [ENV:XDG_DATA_HOME]/saturnin-demo
37
+    __SATURNIN_CACHE_HOME__     = [ENV:XDG_CACHE_HOME]/saturnin-demo
38
+    __SATURNIN_CONFIG_HOME__    = [ENV:XDG_CONFIG_HOME]/saturnin-demo
35
     __SATURNIN_CONFIG_LOCAL__   = [roots:etc]
39
     __SATURNIN_CONFIG_LOCAL__   = [roots:etc]
36
     __SATURNIN_LIBEXEC__        = [roots:libexec]
40
     __SATURNIN_LIBEXEC__        = [roots:libexec]
37
     __SATURNIN_SHARE__          = [roots:share]
41
     __SATURNIN_SHARE__          = [roots:share]
42
+    __SATURNIN_SHELLFU_DIR__    = [roots:share]/shellfu
38
 
43
 
39
 [modes]
44
 [modes]
40
     bin     = 755
45
     bin     = 755

+ 6
- 3
src/bin/app.skel View File

13
     SATURNIN_APP_VERSION="__MKIT_PROJ_VERSION__"
13
     SATURNIN_APP_VERSION="__MKIT_PROJ_VERSION__"
14
     SATURNIN_APP_GIT_HASH="__MKIT_PROJ_GIT_LASTHASH__"
14
     SATURNIN_APP_GIT_HASH="__MKIT_PROJ_GIT_LASTHASH__"
15
     SATURNIN_CACHE_HOME="__SATURNIN_CACHE_HOME__"
15
     SATURNIN_CACHE_HOME="__SATURNIN_CACHE_HOME__"
16
+    SATURNIN_CONFIG_HOME="__SATURNIN_CONFIG_HOME__"
17
+    SATURNIN_DATA_HOME="__SATURNIN_DATA_HOME__"
16
     SATURNIN_LIBEXEC="__SATURNIN_LIBEXEC__"
18
     SATURNIN_LIBEXEC="__SATURNIN_LIBEXEC__"
17
     SATURNIN_LIBEXEC_PREFIX="__MKIT_PROJ_PKGNAME__-"
19
     SATURNIN_LIBEXEC_PREFIX="__MKIT_PROJ_PKGNAME__-"
20
+    SHELLFU_PATH="__SATURNIN_SHELLFU_DIR__"
18
     PRETTY_USAGE="subcommand"
21
     PRETTY_USAGE="subcommand"
19
 }
22
 }
20
 
23
 
22
 
25
 
23
 SATURNIN_CONF_PATH="$(
26
 SATURNIN_CONF_PATH="$(
24
     saturnin__conf_mkpath \
27
     saturnin__conf_mkpath \
25
-        __SATURNIN_CONFIG_USER__/ini.d \
26
-        __SATURNIN_CONFIG_USER__ \
28
+        __SATURNIN_CONFIG_HOME__/ini.d \
29
+        __SATURNIN_CONFIG_HOME__ \
27
         __SATURNIN_CONFIG_LOCAL__ \
30
         __SATURNIN_CONFIG_LOCAL__ \
28
         __SATURNIN_SHARE__/ini.d
31
         __SATURNIN_SHARE__/ini.d
29
 )"
32
 )"
33
 #
36
 #
34
 
37
 
35
 export SATURNIN_CONF_PATH SHELLFU_PATH PRETTY_USAGE \
38
 export SATURNIN_CONF_PATH SHELLFU_PATH PRETTY_USAGE \
36
-       SATURNIN_CACHE_HOME
39
+       SATURNIN_CACHE_HOME SATURNIN_CONFIG_HOME SATURNIN_DATA_HOME
37
 
40
 
38
 saturnin__main "$@"
41
 saturnin__main "$@"