Reorginazation after switching to GNU Stow for organizing dotfiles

This commit is contained in:
2017-04-05 12:11:27 -04:00
parent e0445597d6
commit 7c52136278
205 changed files with 36928 additions and 82 deletions

56
bash/.aliases Normal file
View File

@@ -0,0 +1,56 @@
#{- ~/.aliases -}#
#{- FILE OPERATIONS -}#
# Allow alias expansion for commands executed with sudo
alias sudo="sudo "
#{- GNU coreutils -}#
# Sort directories first and colorize output
alias ls="ls -h --color=auto --group-directories-first"
alias la="ls -A"
alias ll="ls -l"
# Ask before overwriting files
alias mv="mv -i"
alias cp="cp -i"
alias rm="rm -i --preserve-root --one-file-system"
# Create and remove empty subdirectories
alias mkdir="mkdir -p"
alias rmdir="rmdir -p"
# Don't recursively modify permissions on root directory
alias chmod="chmod --preserve-root"
alias chown="chown --preserve-root"
alias chgrp="chgrp --preserve-root"
# Colorize output
alias grep="grep --color"
alias egrep="grep -E --color"
alias fgrep='grep -F --color'
# Human readable file system inspection
alias df="df -h"
# Human readable file size inspection
alias du="du -sh"
#{- NETWORKING -}#
# Don't ping infinitely
alias ping="ping -c 4"
# Show progress while syncing
alias rsync="rsync --progress"
#{- SHELL INTROSPECTION -}#
# Print the value of the $PATH variable in a human readable format
alias path='printf "${PATH//:/\\n}\n"'
# Print current aliases in a human readable format
alias aliases='alias | sed -e "s/=/ -> /" -e "s/alias //"'

58
bash/.bash_profile Normal file
View File

@@ -0,0 +1,58 @@
#{- ~/.bash_profile -}#
#{- PROMPT -}#
# Debugging prompt: (? ) in blue
export PS4='\[\033[1;34\]m?\[\033[0m\] '
# Selection prompt: (select: )
export PS3='select: '
#{- ENVIRONMENT VARIABLES -}#
# History preferences
if [ -w "$HOME/.history/bash" ]; then
if [ ! -d "$HOME/.history" ]; then
mkdir "$HOME/.history"
fi
touch "$HOME/.history/bash"
fi
export HISTCONTROL="erasedups:ignoreboth"
export HISTFILE="$HOME/.history/bash"
export HISTFILESIZE=-1
export HISTSIZE=-1
#{- SHELL OPTIONS -}#
# Append history to $HISTFILE when bash exits, instead of overwriting it
shopt -s histappend
# Attempt to preserve multi-line commands in history with embedded newlines
shopt -s cmdhist lithist
# When doing history substitution load the results into the buffer
shopt -s histverify
# When doing history substitution load a failed expression into the buffer
shopt -s histreedit
# Do a path search if a hashed command no longer exists
shopt -s checkhash
# Enable extended pattern matching for interactive use
shopt -s extglob
#{- SOURCING -}#
# Source ~/.profile if it exists and is readable
if [ -f "$HOME/.profile" ] && [ -r "$HOME/.profile" ]; then
. "$HOME/.profile"
fi
# Source ~/.bashrc if it exists and is readable
if [ -f "$HOME/.bashrc" ] && [ -r "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi

29
bash/.bashrc Normal file
View File

@@ -0,0 +1,29 @@
#{- ~/.bashrc -}#
#{- SOURCING -}#
# Source aliases
if [ -f "$HOME/.aliases" ] && [ -r "$HOME/.aliases" ]; then
. "$HOME/.aliases"
fi
# Source private aliases
if [ -f "$HOME/.private_aliases" ] && [ -r "$HOME/.private_aliases" ]; then
. "$HOME/.private_aliases"
fi
# Source functions
if [ -f "$HOME/.functions" ] && [ -r "$HOME/.functions" ]; then
. "$HOME/.functions"
fi
# Source private functions
if [ -f "$HOME/.private_functions" ] && [ -r "$HOME/.private_functions" ]; then
. "$HOME/.private_functions"
fi
# Source completion
if [ -f "$HOME/.nix-profile/etc/profile.d/bash_completion.sh" ] && \
[ -r "$HOME/.nix-profile/etc/profile.d/bash_completion.sh" ]; then
. "$HOME/.nix-profile/etc/profile.d/bash_completion.sh"
fi

17
bash/.functions Normal file
View File

@@ -0,0 +1,17 @@
#{- ~/.functions -}#
# Enables or disables kwm hotkeys
hotkeys()
{
case "$1" in
"on") kwmc config hotkeys on; echo "Hotkeys enabled." ;;
"off") kwmc config hotkeys off; echo "Hotkeys disabled." ;;
*) printf "hotkeys: usage: hotkeys {on|off}\n" ;;
esac
}
# Passes basic arithmetic to bc
maths()
{
bc -l <<< "scale=2; $*"
}