aboutsummaryrefslogtreecommitdiffstats
path: root/bash
diff options
context:
space:
mode:
Diffstat (limited to 'bash')
-rwxr-xr-xbash/.bashrc18
1 files changed, 18 insertions, 0 deletions
diff --git a/bash/.bashrc b/bash/.bashrc
index 7e460bb..c71c184 100755
--- a/bash/.bashrc
+++ b/bash/.bashrc
@@ -5,14 +5,18 @@
5# If not running interactively, don't do anything 5# If not running interactively, don't do anything
6[[ $- != *i* ]] && return 6[[ $- != *i* ]] && return
7 7
8# Default PS1
8export PS1='[\d][\t]\u on \h\n\w $ ' 9export PS1='[\d][\t]\u on \h\n\w $ '
9 10
11# Additional local paths
10export PATH="$PATH:$HOME/.local/bin" 12export PATH="$PATH:$HOME/.local/bin"
11export PATH="$PATH:$HOME/.local/usr/bin" 13export PATH="$PATH:$HOME/.local/usr/bin"
12export PATH="$PATH:$HOME/.local/usr/local/bin" 14export PATH="$PATH:$HOME/.local/usr/local/bin"
13 15
16# Quit the shell like in vim
14alias :q="exit" 17alias :q="exit"
15 18
19# Keep OS compatibility
16case "$(uname)" in 20case "$(uname)" in
17 Linux) 21 Linux)
18 alias ls="ls --color=auto" 22 alias ls="ls --color=auto"
@@ -28,6 +32,7 @@ case "$(uname)" in
28 ;; 32 ;;
29esac 33esac
30 34
35# Colorfull manpages
31man() { 36man() {
32 env LESS_TERMCAP_mb=$'\E[01;31m' \ 37 env LESS_TERMCAP_mb=$'\E[01;31m' \
33 LESS_TERMCAP_md=$'\E[01;38;5;74m' \ 38 LESS_TERMCAP_md=$'\E[01;38;5;74m' \
@@ -39,6 +44,7 @@ man() {
39 man "$@" 44 man "$@"
40} 45}
41 46
47# Helpfull functions
42exists() { 48exists() {
43 hash $@ 2> /dev/null 49 hash $@ 2> /dev/null
44} 50}
@@ -61,6 +67,7 @@ is_alias() {
61 fi 67 fi
62} 68}
63 69
70# Execute functions and aliasses with sudo
64if exists sudo; then 71if exists sudo; then
65 sudo() { 72 sudo() {
66 # Allow functions and aliasses to be executed with sudo 73 # Allow functions and aliasses to be executed with sudo
@@ -88,16 +95,19 @@ if exists sudo; then
88 } 95 }
89fi 96fi
90 97
98# Set autocomplete for sudo
91if exists complete && exists sudo; then 99if exists complete && exists sudo; then
92 complete -cf sudo 100 complete -cf sudo
93fi 101fi
94 102
103# Jupiterbroadcasting live stream
95if exists mpv; then 104if exists mpv; then
96 alias jblive='mpv rtmp://videocdn-us.geocdn.scaleengine.net/jblive/live/jblive.stream' 105 alias jblive='mpv rtmp://videocdn-us.geocdn.scaleengine.net/jblive/live/jblive.stream'
97elif exists vlc; then 106elif exists vlc; then
98 alias jblive='vlc rtmp://videocdn-us.geocdn.scaleengine.net/jblive/live/jblive.stream' 107 alias jblive='vlc rtmp://videocdn-us.geocdn.scaleengine.net/jblive/live/jblive.stream'
99fi 108fi
100 109
110# Set the default editor
101if exists nvim; then 111if exists nvim; then
102 export EDITOR="nvim" 112 export EDITOR="nvim"
103elif exists vim; then 113elif exists vim; then
@@ -117,6 +127,7 @@ vim() {
117 fi 127 fi
118} 128}
119 129
130# Programming language specifics
120if exists go; then 131if exists go; then
121 export GOPATH="$HOME/programming/go" 132 export GOPATH="$HOME/programming/go"
122 export PATH="$PATH:$GOPATH/bin" 133 export PATH="$PATH:$GOPATH/bin"
@@ -127,12 +138,14 @@ if exists gem; then
127 export PATH="$PATH:$GEM_HOME" 138 export PATH="$PATH:$GEM_HOME"
128fi 139fi
129 140
141# Ezjail shortcuts
130if exists ezjail-admin && exists sudo; then 142if exists ezjail-admin && exists sudo; then
131 jl() { 143 jl() {
132 sudo ezjail-admin $1 $2\.tomvanderlee.com 144 sudo ezjail-admin $1 $2\.tomvanderlee.com
133 } 145 }
134fi 146fi
135 147
148# Showbanned ipadresses
136if exists pfctl && exists sudo; then 149if exists pfctl && exists sudo; then
137 showbanned () 150 showbanned ()
138 { 151 {
@@ -150,14 +163,17 @@ if exists pfctl && exists sudo; then
150 } 163 }
151fi 164fi
152 165
166# Always use pacaur even if it is not installed
153if (exists pacman && ! exists pacaur) && exists sudo; then 167if (exists pacman && ! exists pacaur) && exists sudo; then
154 alias pacaur="sudo pacman" 168 alias pacaur="sudo pacman"
155fi 169fi
156 170
171# Set the default pager
157if exists less; then 172if exists less; then
158 export PAGER="less" 173 export PAGER="less"
159fi 174fi
160 175
176# Pip upgrade script
161if exists pip; then 177if exists pip; then
162 pip() { 178 pip() {
163 if [[ "$1" == "upgrade" ]] || [[ "$1" == "update" ]]; then 179 if [[ "$1" == "upgrade" ]] || [[ "$1" == "update" ]]; then
@@ -175,10 +191,12 @@ if exists pip; then
175 } 191 }
176fi 192fi
177 193
194# Fancy bash prompt
178if exists liquidprompt; then 195if exists liquidprompt; then
179 source liquidprompt 196 source liquidprompt
180fi 197fi
181 198
199# Fancy system info
182if exists archey3; then 200if exists archey3; then
183 archey3 201 archey3
184elif exists screenfetch; then 202elif exists screenfetch; then