add bash profile and other related things

This commit is contained in:
frosty 2024-05-28 16:10:46 -04:00
parent a5e0c35c8c
commit cc7d9208e3
2 changed files with 6 additions and 23 deletions

5
bash/.bash_profile Normal file
View file

@ -0,0 +1,5 @@
[ -f "$HOME/.profile" ] && . "$HOME/.profile"
case "$-" in
*i*) [ -f "$HOME/.bashrc" ] && . "$HOME/.bashrc" ;;
esac

View file

@ -1,59 +1,37 @@
####################
# Options #
####################
[ -z "$PS1" ] && return
shopt -s autocd
####################
# Sourcing #
####################
# Shortcuts for directories and files
[ -f "$XDG_CONFIG_HOME/shell/shortcuts" ] && . "$XDG_CONFIG_HOME/shell/shortcuts"
####################
# Aliases #
####################
# Program settings
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias cat='bat --style=plain'
alias xdg-ninja='xdg-ninja --skip-unsupported'
# Fix mistakes
alias sudo='doas'
alias vim='nvim'
alias code='codium'
alias fetch='fastfetch'
# Verbose options
alias cp='cp -iv'
alias mv='mv -iv'
alias rm='rm -vI'
alias mkdir='mkdir -pv'
# Human-readable output
alias df='df -h'
alias free='free -h'
# ls shorthands
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
####################
# Functions #
####################
# Installs suckless programs
skinstall() {
rm config.h
make || return
doas make install
}
# Extracts different archive types
ex() {
if [ -n "$1" ] && [ -f "$1" ]; then
case $1 in