b0cbd85d4828dbdbdd679098deada38598389f61
1 # Bash initialization for interactive non-login shells and
2 # for remote shells (info "(bash) Bash Startup Files").
4 # Export 'SHELL' to child processes. Programs such as 'screen'
5 # honor it and otherwise use /bin/sh.
10 # We are being invoked from a non-interactive shell. If this
11 # is an SSH session (as in "ssh host command"), source
12 # /etc/profile so we get PATH and other essential variables.
13 [[ -n "$SSH_CLIENT" ]] && source /etc
/profile
15 # Don't do anything else.
19 if [ -n "$IS_GUIX_SYSTEM" ]; then
20 # Source the system-wide file.
30 local TITLEBAR
='\[\033]0;\h:\w\007\]'
38 $([ $(id -u) = "0" ] && printf "\
[\e
[1;31m\
]")\
40 $([ -n "$GUIX_ENVIRONMENT" ] && printf " [env
]")\
42 $([ $(id -u) = "0" ] && printf "\
[\e
[00m\
]")\
50 # i-beam cursor (uncomment one of the two):
51 # echo -e "\033[5 q" # blinking
52 # echo -e "\033[6 q" # non-blinking
54 # general configuration and completions
55 # -------------------------------------
57 # disallow overwriting existing file using redirection
59 # append to the history file, don't overwrite it
62 # check the window size after each command and, if necessary,
63 # update the values of LINES and COLUMNS.
65 # If set, the pattern "**" used in a pathname expansion context will
66 # match all files and zero or more directories and subdirectories.
68 # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
71 # don't put duplicate lines or lines starting with space in the
73 HISTCONTROL
=ignoreboth
74 # ignore a few very common commands and don't add them to history
75 #HISTIGNORE='ls:l:ll:s:g:[bf]g:history:da:li'
76 HISTTIMEFORMAT
='%F %T '
79 # enable programmable completion features (not needed if already
80 # enabled in /etc/bash.bashrc and if /etc/profile sources
82 if ! shopt -oq posix
; then
83 if [ -f /usr
/share
/bash-completion
/bash_completion
]; then
84 .
/usr
/share
/bash-completion
/bash_completion
85 elif [ -f /etc
/bash_completion
]; then
86 .
/etc
/bash_completion
90 # source Guix shell config dirs, for vte.sh and bash completions
91 GUIX_PROFILES
=("${HOME}/.guix-profile"
92 "${HOME}/.config/guix/current")
93 for profile
in "${GUIX_PROFILES[@]}"; do
94 for dir
in "${profile}/etc/bash_completion.d" "${profile}/etc/profile.d"; do
95 if [ -d "${dir}" ]; then
96 for f
in "${dir}"/*; do
103 # aliases and functions
104 # ---------------------
106 if [ -f ~
/.bash_aliases
]; then
110 alias ls='ls -p --color=auto'
111 alias l
='ls -lh' # long format and human-readable sizes
112 alias ll
='l -A' # long format, all files
113 alias dir
='dir --color=auto'
114 alias vdir='vdir --color=auto'
115 alias grep='grep --color=auto'
116 alias fgrep
='fgrep --color=auto'
117 alias egrep='egrep --color=auto'
118 alias mpv
="mpv --ytdl-format=mp4"
121 alias mbsync
='mbsync -c "$XDG_CONFIG_HOME"/isync/mbsyncrc'
122 alias getmail
='getmail --getmaildir "$XDG_CONFIG_HOME"/getmail --rcfile getmailrc'
123 alias m
="mbsync csclub; mbsync uwaterloo; mbsync shemshak; mbsync gnub"
124 alias best
="youtube-dl -f best"
126 alias se
="SUDO_EDITOR=\"emacsclient\" sudo -e"
129 alias da
='change-theme dark'
130 alias li
='change-theme light'
132 alias dquilt
="quilt --quiltrc=${HOME}/.quiltrc-dpkg"
133 complete
-F _quilt_completion
-o filenames dquilt
136 cd $
(mktemp
-d /tmp
/$1.XXXX
)