Skip to content
Draft
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
63cabef
install: use `.bashrc` and notify user
gaelicWizard Mar 4, 2022
15b32cd
install: cleanup
gaelicWizard Jan 28, 2022
66290a3
uninstall: cleanup
gaelicWizard Jan 28, 2022
7f5e918
docs: fix references to `~/.bashrc`
gaelicWizard Jan 29, 2022
a8f01ac
install: `_bash-it-install-modify-profile()`
gaelicWizard Jan 29, 2022
0a8af69
uninstall: //echo/printf
gaelicWizard Feb 15, 2022
ca09e40
uninstall: try to determine initialization file
gaelicWizard Mar 4, 2022
fc11cfa
template: `shfmt`
gaelicWizard Feb 12, 2022
15db04d
template: `shellcheck`
gaelicWizard Feb 12, 2022
7fb1a42
lib: delete `appearance.bash`
gaelicWizard Jan 30, 2022
e048417
make aliases load very late
gaelicWizard Jan 25, 2022
c90b56e
template: remove `$SHORT_HOSTNAME`
gaelicWizard Feb 12, 2022
bf22649
pathmunge tests
gaelicWizard Jan 18, 2022
ad53972
plugins/go: simplify _bash-it-gopath-pathmunge()
gaelicWizard Sep 24, 2021
1f768a9
aliases/general: minor fixes
gaelicWizard Feb 18, 2022
c6d1721
plugins/xterm: not just Xterm
gaelicWizard Dec 27, 2021
c6cfb13
lib/battery: rename `plugin/battery`
gaelicWizard Mar 4, 2022
c0ba4c9
plugin/ble.sh
gaelicWizard Feb 20, 2022
8fce1fe
shfmt had a word or two
May 5, 2025
fc4b154
battery moved to lib, so should the refering code.
May 5, 2025
787235f
shellcheck
May 5, 2025
a091c77
caught by github sec scanner
May 5, 2025
bcc2d58
seems this is how bats prefer it to be run
May 5, 2025
52f4155
Merge branch 'master' into gaelic-plugins
Jul 13, 2025
f14059a
Merge branch 'master' into gaelic-plugins
seefood Jul 13, 2025
8664903
shfmt fix
Jul 13, 2025
0f81621
Merge branch 'gaelic-plugins' of github.com:seefood/bash-it into gael…
Jul 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions aliases/available/general.aliases.bash
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ fi
# List directory contents
alias sl=ls
alias la='ls -AF' # Compact view, show hidden
alias ll='ls -al'
alias l='ls -a'
alias ll='ls -Al'
alias l='ls -A'
alias l1='ls -1'
alias lf='ls -F'

Expand Down Expand Up @@ -47,8 +47,8 @@ alias py='python'
alias ipy='ipython'

# Pianobar can be found here: http://github.com/PromyLOPh/pianobar/

alias piano='pianobar'
_command_exists pianobar \
&& alias piano='pianobar'

alias ..='cd ..' # Go up one directory
alias cd..='cd ..' # Common misspelling for going up one directory
Expand All @@ -73,7 +73,12 @@ alias rd='rmdir'
alias rmrf='rm -rf'

# Shorten extract
alias xt='extract'
_command_exists 'extract' \
&& alias xt='extract'

# sudo editors
alias svim='sudo "${VISUAL:-vim}"'
alias snano='sudo "${ALTERNATE_EDITOR:-nano}"'

# Display whatever file is regular file or folder
function catt() {
Expand Down
18 changes: 10 additions & 8 deletions bash_it.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ _bash_it_library_finalize_hook=()
# We need to load logging module early in order to be able to log
source "${BASH_IT}/lib/log.bash"

# libraries, but skip appearance (themes) for now
_log_debug "Loading libraries(except appearance)..."
APPEARANCE_LIB="${BASH_IT}/lib/appearance.bash"
# Load libraries
_log_debug "Loading libraries..."
for _bash_it_main_file_lib in "${BASH_IT}/lib"/*.bash; do
[[ "$_bash_it_main_file_lib" == "$APPEARANCE_LIB" ]] && continue
_bash-it-log-prefix-by-path "${_bash_it_main_file_lib}"
_log_debug "Loading library file..."
# shellcheck disable=SC1090
Expand Down Expand Up @@ -55,10 +53,14 @@ if [[ -n "${BASH_IT_THEME:-}" ]]; then
source "${BASH_IT}/themes/base.theme.bash"

BASH_IT_LOG_PREFIX="lib: appearance: "
# appearance (themes) now, after all dependencies
# shellcheck source=SCRIPTDIR/lib/appearance.bash
source "$APPEARANCE_LIB"
BASH_IT_LOG_PREFIX="core: main: "
# shellcheck disable=SC1090
if [[ -f "${BASH_IT_THEME}" ]]; then
source "${BASH_IT_THEME}"
elif [[ -f "$CUSTOM_THEME_DIR/$BASH_IT_THEME/$BASH_IT_THEME.theme.bash" ]]; then
source "$CUSTOM_THEME_DIR/$BASH_IT_THEME/$BASH_IT_THEME.theme.bash"
elif [[ -f "$BASH_IT/themes/$BASH_IT_THEME/$BASH_IT_THEME.theme.bash" ]]; then
source "$BASH_IT/themes/$BASH_IT_THEME/$BASH_IT_THEME.theme.bash"
fi
fi

_log_debug "Loading custom aliases, completion, plugins..."
Expand Down
2 changes: 2 additions & 0 deletions clean_files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ hooks/
lib/
plugins/
scripts/
template/
test/

# root files
Expand All @@ -32,6 +33,7 @@ bash_it.sh
clean_files.txt
install.sh
lint_clean_files.sh
uninstall.sh

# themes
#
Expand Down
14 changes: 6 additions & 8 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Installation

#. Check out a clone of this repo to a location of your choice, such as
``git clone --depth=1 https://github.com/Bash-it/bash-it.git ~/.bash_it``
#. Run ``~/.bash_it/install.sh`` (it automatically backs up your ``~/.bash_profile`` or ``~/.bashrc``\ , depending on your OS)
#. Edit your modified config (\ ``~/.bash_profile`` or ``~/.bashrc``\ ) file in order to customize Bash-it.
#. Run ``~/.bash_it/install.sh`` (it automatically backs up your ``~/.bashrc``\ )
#. Edit your modified config (\ ``~/.bashrc``\ ) file in order to customize Bash-it.
#. Check out available aliases, completions, and plugins and enable the ones you want to use (see the next section for more details).

Install Options
Expand All @@ -18,7 +18,7 @@ The install script can take the following options:

* ``--interactive``\ : Asks the user which aliases, completions and plugins to enable.
* ``--silent``\ : Ask nothing and install using default settings.
* ``--no-modify-config``\ : Do not modify the existing config file (\ ``~/.bash_profile`` or ``~/.bashrc``\ ).
* ``--no-modify-config``\ : Do not modify the existing config file (\ ``~/.bashrc``\ ).
* ``--append-to-config``\ : Back up existing config file and append bash-it templates at the end.

When run without the ``--interactive`` switch, Bash-it only enables a sane default set of functionality to keep your shell clean and to avoid issues with missing dependencies.
Expand All @@ -28,16 +28,14 @@ When you run without the ``--no-modify-config`` switch, the Bash-it installer au
Use the ``--no-modify-config`` switch to avoid unwanted modifications, e.g. if your Bash config file already contains the code that loads Bash-it.

**NOTE**\ : Keep in mind how Bash loads its configuration files,
``.bash_profile`` for login shells (and in macOS in terminal emulators like `Terminal.app <http://www.apple.com/osx/apps/>`_ or
`iTerm2 <https://www.iterm2.com/>`_\ ) and ``.bashrc`` for interactive shells (default mode in most of the GNU/Linux terminal emulators),
to ensure that Bash-it is loaded correctly.
``.bash_profile`` for login shells and ``.bashrc`` for interactive shells, to ensure that Bash-it is loaded correctly.
A good "practice" is sourcing ``.bashrc`` into ``.bash_profile`` to keep things working in all the scenarios.
To achieve this, you can add this snippet in your ``.bash_profile``\ :

.. code-block::

if [ -f ~/.bashrc ]; then
. ~/.bashrc
if [[ $- == *"i"* && -f ~/.bashrc ]]; then
source ~/.bashrc
fi

Refer to the official `Bash documentation <https://www.gnu.org/software/bash/manual/bashref.html#Bash-Startup-Files>`_ to get more info.
Expand Down
3 changes: 1 addition & 2 deletions docs/themes-list/atomic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ Automatically via terminal


#. You can install the theme automatically using the ``sed`` command from your Linux or OSX Terminal.
#. On macOS, the ~/.bash_profile is used, not the ~/.bashrc.
#. For installation on windows you should use `\ ``Git-Bash`` <https://git-for-windows.github.io/>`_ or make sure the terminal emulator you use (ej: cygwin, mintty, etc) has the ``sed`` command installed.

Command to execute For Windows and Linux:
Expand All @@ -51,7 +50,7 @@ Command to execute for macOS:
.. code-block:: bash

# Set the "atomic" theme replacing the theme you are using of bash-it
sed -i '' 's/'"$BASH_IT_THEME"'/atomic/g' ~/.bash_profile
sed -i '' 's/'"$BASH_IT_THEME"'/atomic/g' ~/.bashrc

Features
--------
Expand Down
2 changes: 1 addition & 1 deletion docs/themes-list/powerline-base.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ all powerline themes.

**IMPORTANT:** This theme requires that `a font with the Powerline symbols <https://github.com/powerline/fonts>`_ needs to be used in your terminal emulator, otherwise the prompt won't be displayed correctly, i.e. some of the additional icons and characters will be missing. Please follow your operating system's instructions to install one of the fonts from the above link and select it in your terminal emulator.

**NOTICE:** The default behavior of this theme assumes that you have sudo privileges on your workstation. If that is not the case (e.g. if you are running on a corporate network where ``sudo`` usage is tracked), you can set the flag 'export THEME_CHECK_SUDO=false' in your ``~/.bashrc`` or ``~/.bash_profile`` to disable the Powerline theme's ``sudo`` check. This will apply to all ``powerline*`` themes.
**NOTICE:** The default behavior of this theme assumes that you have sudo privileges on your workstation. If that is not the case (e.g. if you are running on a corporate network where ``sudo`` usage is tracked), you can set the flag 'export THEME_CHECK_SUDO=false' in your ``~/.bashrc`` to disable the Powerline theme's ``sudo`` check. This will apply to all ``powerline*`` themes.

Provided Information
--------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/themes-list/powerline-multiline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ To get the length of the left and right segments right, a *padding* value is use
In most cases, the default value (\ *2*\ ) works fine, but on some operating systems, this needs to be adjusted.
One example is *macOS High Sierra*\ , where the default padding causes the right segment to extend to the next line.
On macOS High Sierra, the padding value needs to be changed to *3* to make the theme look right.
This can be done by setting the ``POWERLINE_PADDING`` variable before Bash-it is loaded, e.g. in your ``~/.bash_profile`` or ``~/.bashrc`` file:
This can be done by setting the ``POWERLINE_PADDING`` variable before Bash-it is loaded, e.g. in your ``~/.bashrc`` file:

.. code-block:: bash

Expand Down
2 changes: 1 addition & 1 deletion docs/vcs_user.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Turn version control checking off to prevent slow directory navigation within la
Controlling Flags
^^^^^^^^^^^^^^^^^

Bash-it provides a flag (\ ``SCM_CHECK``\ ) within the ``~/.bash_profile`` file that turns off/on version control information checking and display within all themes.
Bash-it provides a flag (\ ``SCM_CHECK``\ ) within the ``~/.bashrc`` file that turns off/on version control information checking and display within all themes.
Version control checking is on by default unless explicitly turned off.

Set ``SCM_CHECK`` to 'false' to **turn off** version control checks for all themes:
Expand Down
Loading
Loading