Adding simple bashrc

This commit is contained in:
Dorian Wood 2021-03-26 10:37:42 -04:00
parent 93695bc69f
commit e84e2263d9
1 changed files with 58 additions and 0 deletions

58
dot_bashrc Normal file
View File

@ -0,0 +1,58 @@
# Bash initialization for interactive non-login shells and
# for remote shells (info "(bash) Bash Startup Files").
# Export 'SHELL' to child processes. Programs such as 'screen'
# honor it and otherwise use /bin/sh.
export SHELL
if [[ $- != *i* ]]
then
# 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.
[[ -n "$SSH_CLIENT" ]] && source /etc/profile
# Don't do anything else.
return
fi
# Source the system-wide file.
source /etc/bashrc
# Adjust the prompt depending on whether we're in 'guix environment'.
if [ -n "$GUIX_ENVIRONMENT" ]
then
PS1='\u@\h \w [env]\$ '
else
PS1='\u@\h \w\$ '
fi
# Remap the capslock key because it's useless
setxkbmap -option caps:super
# Single press of the super key should send an Escape code
killall xcape 2>dev/null; xcape -e 'Super_L=Escape'
# Aliases
# ALL THE COLORS
alias \
ls='ls -hp --color=auto --group-directories-first' \
grep='grep --color=auto'
# Short alias modifications that we always want
alias \
ll='ls -l' \
la='ls -a' \
cp='cp -iv' \
mv='mv -iv' \
rm='rm -vI' \
..='cd ..'
# du sort by size please
alias du='du -hs * | sort -h'
# Shortcuts for common directories
alias \
cf='cd ${XDG_CONFIG_HOME:-$HOME/.config} && ls -a --color=auto' \
sc='cd ~/.local/bin/ && ls -a --color=auto'
GUIX_PROFILE="/home/dorian/.guix-profile"
source "$GUIX_PROFILE/etc/profile"