diff options
Diffstat (limited to 'bash/.bashrc')
| -rwxr-xr-x | bash/.bashrc | 18 |
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 | ||
| 8 | export PS1='[\d][\t]\u on \h\n\w $ ' | 9 | export PS1='[\d][\t]\u on \h\n\w $ ' |
| 9 | 10 | ||
| 11 | # Additional local paths | ||
| 10 | export PATH="$PATH:$HOME/.local/bin" | 12 | export PATH="$PATH:$HOME/.local/bin" |
| 11 | export PATH="$PATH:$HOME/.local/usr/bin" | 13 | export PATH="$PATH:$HOME/.local/usr/bin" |
| 12 | export PATH="$PATH:$HOME/.local/usr/local/bin" | 14 | export PATH="$PATH:$HOME/.local/usr/local/bin" |
| 13 | 15 | ||
| 16 | # Quit the shell like in vim | ||
| 14 | alias :q="exit" | 17 | alias :q="exit" |
| 15 | 18 | ||
| 19 | # Keep OS compatibility | ||
| 16 | case "$(uname)" in | 20 | case "$(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 | ;; |
| 29 | esac | 33 | esac |
| 30 | 34 | ||
| 35 | # Colorfull manpages | ||
| 31 | man() { | 36 | man() { |
| 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 | ||
| 42 | exists() { | 48 | exists() { |
| 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 | ||
| 64 | if exists sudo; then | 71 | if 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 | } |
| 89 | fi | 96 | fi |
| 90 | 97 | ||
| 98 | # Set autocomplete for sudo | ||
| 91 | if exists complete && exists sudo; then | 99 | if exists complete && exists sudo; then |
| 92 | complete -cf sudo | 100 | complete -cf sudo |
| 93 | fi | 101 | fi |
| 94 | 102 | ||
| 103 | # Jupiterbroadcasting live stream | ||
| 95 | if exists mpv; then | 104 | if 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' |
| 97 | elif exists vlc; then | 106 | elif 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' |
| 99 | fi | 108 | fi |
| 100 | 109 | ||
| 110 | # Set the default editor | ||
| 101 | if exists nvim; then | 111 | if exists nvim; then |
| 102 | export EDITOR="nvim" | 112 | export EDITOR="nvim" |
| 103 | elif exists vim; then | 113 | elif exists vim; then |
| @@ -117,6 +127,7 @@ vim() { | |||
| 117 | fi | 127 | fi |
| 118 | } | 128 | } |
| 119 | 129 | ||
| 130 | # Programming language specifics | ||
| 120 | if exists go; then | 131 | if 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" |
| 128 | fi | 139 | fi |
| 129 | 140 | ||
| 141 | # Ezjail shortcuts | ||
| 130 | if exists ezjail-admin && exists sudo; then | 142 | if 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 | } |
| 134 | fi | 146 | fi |
| 135 | 147 | ||
| 148 | # Showbanned ipadresses | ||
| 136 | if exists pfctl && exists sudo; then | 149 | if exists pfctl && exists sudo; then |
| 137 | showbanned () | 150 | showbanned () |
| 138 | { | 151 | { |
| @@ -150,14 +163,17 @@ if exists pfctl && exists sudo; then | |||
| 150 | } | 163 | } |
| 151 | fi | 164 | fi |
| 152 | 165 | ||
| 166 | # Always use pacaur even if it is not installed | ||
| 153 | if (exists pacman && ! exists pacaur) && exists sudo; then | 167 | if (exists pacman && ! exists pacaur) && exists sudo; then |
| 154 | alias pacaur="sudo pacman" | 168 | alias pacaur="sudo pacman" |
| 155 | fi | 169 | fi |
| 156 | 170 | ||
| 171 | # Set the default pager | ||
| 157 | if exists less; then | 172 | if exists less; then |
| 158 | export PAGER="less" | 173 | export PAGER="less" |
| 159 | fi | 174 | fi |
| 160 | 175 | ||
| 176 | # Pip upgrade script | ||
| 161 | if exists pip; then | 177 | if 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 | } |
| 176 | fi | 192 | fi |
| 177 | 193 | ||
| 194 | # Fancy bash prompt | ||
| 178 | if exists liquidprompt; then | 195 | if exists liquidprompt; then |
| 179 | source liquidprompt | 196 | source liquidprompt |
| 180 | fi | 197 | fi |
| 181 | 198 | ||
| 199 | # Fancy system info | ||
| 182 | if exists archey3; then | 200 | if exists archey3; then |
| 183 | archey3 | 201 | archey3 |
| 184 | elif exists screenfetch; then | 202 | elif exists screenfetch; then |
