We aim to provide a set of scripts to set the user shell environment.
The scripts are
- built over conventions for an easy setup
- POSIX-compliant : they run on bash, dash, zsh, and more.
- XDG-compliant : they follow the XDG base dir specification and set the user directories
Create the directory /etc/profile.d
.
mkdir /etc/profile.d
Copy all the scripts from this repository in /etc/profilei.d
.
Finally, add the next lines in the file /etc/profile
.
if test -d '/etc/profile.d/'; then
for f in /etc/profile.d/*.sh; do
if test -r "$f"; then
. "$f"
fi
done
unset f
fi
Create the file ${XDG_CONFIG_HOME:-$HOME'/.config'}/dir_colors
and set
your own configuration. See the dir_colors
man page for more details.
Alternatively, you can use an existing configuration, such as solarized theme.
Note that some projects prefer dircolors
instead of dir_colors
.
We support also this name.
Create the file ${XDG_CONFIG_HOME:-$HOME'/.config'}/locale.conf
.
The set of availables are listed on the ArchLinux wiki
A simple example :
LANG=en_US.UTF-8
LC_COLLATE=C
LC_TIME=en_DK.UTF-8
Create the folder ${XDG_CONFIG_HOME:-"$HOME/.config"}/profile.d
.
Every file in this directory with the extension .sh
are sourced.
For instance, you can create a file programs.sh
and export some of the next
variables:
BROWSER
: path to a web browser.EDITOR
: path to a lightweight editor for text file editing. e.g. nanoPAGER
: path to a text file reader. e.g. lessVISUAL
: path to an editor for text file editing. e.g. vim, emacs
If not set, EDITOR
is set to the value of VISUAL
.
If not set, PAGER
is set in the next priority order: most
, less
, more
.
A simple example :
export PAGER=more
export VISUAL=vim
You can directly modify the XDG base directories in
/etc/profile.d/10-xdg-base-dirs.sh
.
Just follow the XDG user dirs specification.
A more partical tutorial is available on the ArchLinux wiki.
Prevent less to write an history at the home user directory.
If the SSH agent is running then the needed environment variable in order to
reach it is exported. This is useful for commands such as ssh-add
.
If the user is in the administrator group wheel
, then the directory
$HOME/.local/bin
is added to the PATH
variable.
THe file $HOME/.Xauthority
is moved to $XDG_RUNTIME_DIR/Xauthority