1 <?xml version="1.0" encoding="UTF-8"?>
13 This specification-by-example defines an easier, more direct and more precise
14 way for applications to set aliases and env vars for a user session.
16 It will, in some ways, substitute the functionality of the files
23 Although on those files some can add code and some logic to define env vars,
24 this key schema is usefull when you just want to set environments in an
27 The /etc/profile.d/elektraenv.sh script loads the environments declared by
28 the keys in this schema.
30 The key hierarchy proposed (as examples) is:
32 Systemwide environments, as in /etc/profile:
36 JAVA_HOME = /opt/IBMJava2
38 PATH = $PATH:$JAVA_HOME/bin
39 LIBPATH = $LIBPATH:$JAVA_HOME/lib
45 User specific environment (loaded after system's), as in ~/.profile
51 LIBPATH = $LIBPATH:~/lib
56 ls = ls -Fh -color=auto
57 ll = ls -l -Fh -color=auto
60 Note that we have env1, env2 and env3 levels.
61 Thats because a script has a natural order for the things to happen, so we
62 can easily define $PATH using $JAVA_HOME, but after defining $JAVA_HOME.
63 Since there is no such natural order when accessing keys and values, the
64 elektraenv script will fetch env1, env2, env3 in this order, then envvars
65 can be defined dependent on previously defined other envvars, as
66 with $PATH depending on $JAVA_HOME.
68 In addition, the elektraenv script will fetch system/env keys before it
69 fetches user/env keys.
71 Avi Alkalay <avi@unix.sh>
75 <keyset xmlns="http://www.libelektra.org"
76 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
77 xsi:schemaLocation="http://www.libelektra.org elektra.xsd">
79 <!-- The systemwide environment and aliases -->
80 <keyset parent="system/env/env1">
81 <key basename="JAVA_HOME" value="/opt/IBMJava2"/>
85 <keyset parent="system/env/env2">
87 <value>$PATH:$JAVA_HOME/bin</value>
88 <comment>Since we are under env2, and $JAVA_HOME was defined in env1, at this point, $JAVA_HOME is already set.</comment>
91 <key basename="LIBPATH" value="$LIBPATH:$JAVA_HOME/lib"/>
95 <keyset parent="system/env/env3">
96 <key basename="EDITOR" value="vi"/>
100 <keyset parent="system/env/alias">
101 <key basename="ll" value="ls -l"/>
107 <!-- The user specific environment and aliases -->
108 <keyset parent="user/env/env2">
109 <key basename="PATH" value="$PATH:~/bin"/>
110 <key basename="LIBPATH" value="$LIBPATH:~/lib"/>
114 <keyset parent="user/env/env3">
115 <key basename="PS1" value="\h:\w\$ "/>
116 <key basename="EDITOR" value="kate"/>
120 <keyset parent="user/env/alias">
121 <key basename="ls" value="ls -Fh --color=tty"/>
122 <key basename="ll" value="ls -l -Fh --color=tty"/>
123 <key basename="vi" value="gvim -x"/>