]> git.vanrenterghem.biz Git - Dotty.git/blob - bash/.bashrc
Support Emacs eat shell.
[Dotty.git] / bash / .bashrc
1 #
2 # ~/.bashrc
3 #
5 # If not running interactively, don't do anything
6 [[ $- != *i* ]] && return
8 alias ls='ls --color=auto'
10 git_branch() {
11   git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
12 }
14 PS1="[\u@\h \W]\[\033[00;32m\]\$(git_branch)\[\033[00m\]\$ "
16 unset SSH_AGENT_PID
17 if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
18   export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
19 fi
21 export GPG_TTY=$(tty)
22 gpg-connect-agent updatestartuptty /bye >/dev/null
24 [ -n "$DISPLAY" ] && export BROWSER=firefox || export BROWSER=w3m
26 source /etc/profile.d/nix-daemon.sh
27 export LOCALE_ARCHIVE=/usr/lib/locale/locale-archive
29 # Initialise pyenv
30 export PYENV_ROOT="$HOME/.pyenv"
31 [[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
32 eval "$(pyenv init -)"
34 # Append "$1" to $PATH when not already in.
35 append_path () {
36     case ":$PATH:" in
37         *:"$1":*)
38             ;;
39         *)
40             PATH="${PATH:+$PATH:}$1"
41     esac
42 }
44 # Append our default paths
45 append_path '/home/frederik/scripts'
47 # Emacs eat shell integration
48 [ -n "$EAT_SHELL_INTEGRATION_DIR" ] && \
49   source "$EAT_SHELL_INTEGRATION_DIR/bash"