GithubHelp home page GithubHelp logo

r9e-bashrc's Introduction

Caution

This repository is no longer maintained. Feel free to fork this repository or use parts of it in your own shell rc. Below is the original README for reference.

This is my personal Bash and ZSH rc. It is currently used on different Linux flavors (mainly Fedora, Debian and Gentoo) and on Mac OS X. It might work on other platforms. If you encounter any problems on your platform, feel free to contact me. Of course patches to make the code more portable are very welcome.

Installation

You can install this bashrc either for one user or system wide, so that it will be used by every user on the system.

In addition to the manual installation and update procedure, there also exists an automatic installer and updater. This currently only works if the bashrc is installed for one user.

System Wide

To install it system wide you have to place the code somewhere (for example /usr/local/share/r9e-bashrc):

mkdir -p /usr/local/share
git clone 'git://github.com/rioderelfte/r9e-bashrc.git' /usr/local/share/r9e-bashrc

Then you have to make sure the src/init.sh file (e.g. /usr/local/share/r9e-bashrc/src/init.sh) gets sourced during the shell start up. On Linux this can be achieved by creating a symbolic link in /etc/profile.d/:

ln -s /usr/local/share/r9e-bashrc/src/init.sh /etc/profile.d/r9e-bashrc.sh

Since all these changes are system wide of course all of the above commands have to be run as root.

Per User

To install the bashrc for one user the code has to be placed somewhere, too (e.g. ~/r9e-bashrc):

git clone 'git://github.com/rioderelfte/r9e-bashrc.git' ~/r9e-bashrc

Then you need to make sure src/init.sh gets sourced. For Bash you either can source it from your ~/.bashrc or you can just link it:

rm .bashrc
ln -s r9e-bashrc/src/init.sh ~/.bashrc

For the ZSH you can source or link it from your ~/.zshrc:

rm .zshrc
ln -s r9e-bashrc/src/init.sh ~/.zshrc

.bashrc and .bash_profile

Since bash only reads ~/.bashrc if it is invoked as an interactive shell that is no login shell (see the reference manual for details), your ~/.bash_profile (or ~/.profile) should source the ~/.bashrc. Most Linux distributions automatically install an appropriate ~/.bash_profile (or ~/.profile on Debian) if you create a new user. If your ~/.bash_profile does not source the bashrc, simply insert something like the following into this file:

if [ -f "${HOME}/.bashrc" ]; then
    source "${HOME}/.bashrc"
fi

Per User With Automatic Updater

To automatically install this bashrc for one user, a convenience script install.sh is provided in this repository. You can execute it by simply running:

curl 'https://raw.githubusercontent.com/rioderelfte/r9e-bashrc/master/install.sh' | sh

The script clones this repository to ~/.r9e/bashrc and installs ~/.bashrc and ~/.zshrc files which will source ~/.r9e/bashrc/src/init.sh. If you already had a ~/.bashrc or ~/.zshrc it will be renamed to ~/.bashrc.pre-r9e or ~/zshrc.pre-r9e respectively. But please see the script itself if you want more details.

The automatic installer does not ensure your ~/.bash_profile sources the bashrc. See the section .bashrc and .bash_profile above for details.

After installing the bashrc this way you will also have an automatic updater. Simply running r9e_bashrc_update will pull the git repository and source the newly fetched bashrc. You will also get a gentle reminder every time you start a new bash if you did not run the updater for at least one week.

Customization

During start up, the bashrc will source several files which can be customized by the user. Apart from the normal bash customization (like shopt, alias and so on) also some of the functions from this bashrc (for example the prompting) can be customized, but I won't go into much detail about this.

Additionally the bashrc supports few options, which have to be set before sourcing the bashrc. For a list of those you can see the ~/.bashrc file generated by the install.sh script. But probably you don't have to change any of these.

The following files are currently sourced during the bashrc start up:

  • /etc/r9e-bashrc.sh
  • ~/.bashrc.local
  • ~/.bash_aliases

Also every file with the file extension .sh from the following directories is sourced:

  • /etc/r9e-bashrc.d
  • ~/.bashrc.d

If these directories contain subdirectories (or symbolic links to directories) named *.d, files from these directories will be sourced recursively.

r9e-bashrc's People

Contributors

hco avatar jakobwesthoff avatar rioderelfte avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

jakobwesthoff hco

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.