aboutsummaryrefslogtreecommitdiff
path: root/bash/.bashrc
blob: f6ce5bf4f367dca98ebce0e446d7a0059289ee92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# If not running interactively, don't do anything
[[ $- != *i* ]] && return

terminal="$(basename "/"$(ps -o cmd -f -p $(cat /proc/$(echo $$)/stat | cut -d \  -f 4) | tail -1 | sed 's/ .*$//'))"

# Define function for easy script sourcing
source_if_present () { [ -f "$1" ] && source $1 ; } 

# Load environment variables
source_if_present "$HOME/.config/env"

# Load wal colors
source_if_present "$HOME/.cache/wal/colors.sh"
# Support TTYs
source_if_present "$HOME/.cache/wal/colors-tty.sh"

# Load bash completion
source_if_present "/usr/share/bash-completion/bash_completion"

# Colors in less
export LESS="--RAW-CONTROL-CHARS"
source_if_present "$HOME/.config/less/termcap"

# Enable tab to cycle-complete
bind '"\t":menu-complete'

# Set aliases
alias ..="cd ../"
alias ...="cd ../../"
alias ls="ls --color=auto"
alias ll="ls -lah --color=auto"

alias stw="stow -v --target=$HOME"

alias clip="xclip -selection clipboard"
alias diff="diff --color=auto"
alias grep="grep --color=auto"
alias hss="hugo server --noHTTPCache"
alias ip="ip --color=auto"
alias lf="lfub"
alias lgit="lazygit"
alias mail="neomutt"
alias mus="ncmpcpp"
alias su="su -"
alias vim="nvim"
alias yp="pwd | clip"
alias ytdl="yt-dlp"
alias zeit="tty-clock -C 1 -f %d.%m.%Y -sc"

export PS1='[\001\e[0;36m\002\j\001\e[0m\002] [ \001\e[0;34m\002\u\001\e[0m\002@\001\e[0;34m\002\h\001\e[0m\002 ] \001\e[0;35m\002\W\001\e[0m\002 \$ '

# Enable wal colors, if terminal emulator is 'st'
if [[ "$terminal" = "st" ]]; then
  [ -f "$HOME/.cache/wal/sequences" ] && (cat "$HOME/.cache/wal/sequences" &)
fi

# trap 'echo -ne "\033]0;$BASH_COMMAND\007"' DEBUG