Git Product home page Git Product logo

profile.d's Introduction

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

Setup

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

Configuration

ls utility colors

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.

User locales

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

User profiles and programs

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. nano
  • PAGER: path to a text file reader. e.g. less
  • VISUAL: 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

XDG base dirs

You can directly modify the XDG base directories in /etc/profile.d/10-xdg-base-dirs.sh.

XDG user dirs

Just follow the XDG user dirs specification.

A more partical tutorial is available on the ArchLinux wiki.

Features

Less

Prevent less to write an history at the home user directory.

SSH

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.

User path

If the user is in the administrator group wheel, then the directory $HOME/.local/bin is added to the PATH variable.

Xorg server

THe file $HOME/.Xauthority is moved to $XDG_RUNTIME_DIR/Xauthority

profile.d's People

Contributors

conaclos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.