abbith/bash/README.org

2.0 KiB

Bash Config

Export SHELL to child processes. Programs such as screen honor it and otherwise use /bin/bash

  export SHELL

We are being invoked from a non-interactive shell. If this is an SSH session (as in ssh host command), source /etc/profile so we get PATH and other essential variables.

  if [[ $- != *i* ]]
  then
      [[ -n "$SSH_CLIENT" ]] && source /etc/profile

      return
  fi

Make sure we have the system-wide config.

  source /etc/bashrc

Adjust the prompt depending on wheather we're in a guix environment.

  if [ -n "$GUIX_ENVIRONMENT" ]
  then
      PS1='\u@\h \w [env]\$ '
  else
      PS1='\u@\h \w\$ '
  fi

History

By default, Bash write its history at the end of each session, overwriting the existing file with an updated version. This means if multiple bash session are open, only the last one to exit will have its history saved.

  shopt -s histappend

Most of the time the following commands just clutter up history or obscures usefull entries. Ignore the following commands

  export HISTIGNORE='exit:ls:ll:cd:pwd:bg:fg:history'

Aliases

  alias ls='ls -p --color=auto'
  alias ll='ls -l'
  alias grep='grep --color=auto'

Variables

  export BROWSER=vimb

Guix

  export GUIX_PROFILE="$HOME/.guix-profile"
  export GUIX_PACKAGE_PATH="$HOME/Source/bbbsd"
  export GUILE_LOAD_PATH="$HOME/.guix-profile/share/guile/site/2.2${GUILE_LOAD_PATH:+:}${GUILE_LOAD_PATH}"
  export GUILE_LOAD_COMPILED_PATH="$HOME/.guix-profile/share/guile/site/2.2/site-ccache${GUILE_LOAD_COMPILED_PATH:+:}${GUILE_LOAD_COMPILED_PATH}"
  export GUIX_LOCPATH="$HOME/.guix-profile/lib/locale"