Ensemble de scripts pour automatiser certaines actions avec les shells « bash » et « zsh »

Guillaume Bernard 4ccf19910f feat: show progress stats when syncing server 4 weeks ago
shellConfig.conf.d 4ccf19910f feat: show progress stats when syncing server 4 weeks ago
.gitignore 08fa9f64c7 Commit initial 2 years ago
LICENSE 08fa9f64c7 Commit initial 2 years ago
README.md 0ee2c0617e fix: update README.md 2 months ago
bashrc fac1b27ded fix: replace tabs with 4 spaces 2 months ago
install.sh 6af6efe337 fix: use double brackets style 2 months ago
profile 61dc3f7aae fix: numlockx not used anymore 2 months ago
shellConfig.conf.example 6378486beb fix: use typeset instead of declare for compatibility 2 months ago
shellrc 21540c5611 feat: add message when loading components 2 months ago
zshrc f154390509 fix: remove command-not-found plugin for zsh 2 months ago

README.md

shellConfig

shellConfig is a tool that automatically configures your shell environment. It works on both zsh (> 5.1) and bash. It offers you some aliases, useful functions by installing libShell.

It can automatically install Powerline fonts, as long as Oh-My-Zsh if you use Zsh.

How to install

Get shellConfig

The first step in the installation process is to get the installer from the Web. This is a shell script that lets you install what you want. In order to execute it, give it the proper rights, using chmod, like as follow:

curl -o install.sh https://code.guillaume-bernard.fr/guilieb/shellConfig/raw/master/install.sh
chmod +x ./install.sh

Install

Once retrieved, you have the following options:

USAGE:
        install.sh [-h] [--help]
                   [--libshell]
                   [--oh-my-zsh]
                   [--powerline-fonts]
                   [--shell-config]
                   [--all]

        --libshell: install LibShell in the user's current home directory

        --oh-my-zsh: install Oh-My-ZSH in the user's current home directory. In
                     order to run properly, you must install zsh.

        --powerline-fonts: install powerline fonts for the current user

        --shell-config: install ShellConfig on the system. Implies installing
                        libShell as well. It enables ShellConfig default 
                        configuration (replaces any custom .profile, .bashrc 
                        or .zshrc)

        --all: install libShell, Powerline fonts, ShellConfig and OhMyZsh.

Reload the shell

As it’s an installation process affecting the shell itself, you’re encouraged to reload it manually, using either source ~/.bashrc or source ~/.zshrc, etc.

Configure

Even if you can use shellConfig without any configuration, to access its full potential, you’re likely to use the two following commands:

  1. importShellConfigExternalDirectory: Import and use your own shell scripts directory.
  2. importShellConfigSetupFile: Use your custom configuration file.

The first one allow you to keep your personnal shell scripts as before. You simply have to call the command with the path containing your scripts. Once done, each time a new shell is loaded, so are your personnal functions and variables located in that directory. Here’s an example of my own:

importShellConfigExternalDirectory ~/Documents/Informatique/Configuration/Scripts\ externes

Then order to benefit from everything in shellConfig, you can also import a shellConfig configuration file. You have an example in this repository, called shellConfig.conf.example. Feel free to copy and modify it. You can import it via the importShellConfigSetupFile command, giving the path to your file as first argument.

importShellConfigSetupFile ~/Documents/Informatique/Configuration/local/shellconfig.vars

Full example

# get the script
curl -o install.sh https://code.guillaume-bernard.fr/guilieb/shellConfig/raw/master/install.sh
chmod +x ./install.sh

# install
./install.sh --all

# setup
importShellConfigSetupFile ~/Documents/Informatique/Configuration/local/shellconfig.vars
importShellConfigExternalDirectory ~/Documents/Informatique/Configuration/Scripts\ externes

How to customize

If you decide to enable shellConfig and change a few things, you can! Keep in mind that the easiest thing is to modify the following files:

  • ~/.bashrc if you use bash;
  • ~/.zshrc if you use zsh;
  • ~/.shellrc if you want to apply a configuration to both shells