diff options
| author | 2016-10-03 09:22:44 +0200 | |
|---|---|---|
| committer | 2016-10-03 09:22:44 +0200 | |
| commit | 1c99670e651c642ae2b5a15c464ce7810653e18c (patch) | |
| tree | 1b6d61f8af46138627f3c5721ed29c5bb319c6bd | |
| parent | a0cd437760188a704f2d77a66ee081561431043c (diff) | |
| download | dotfiles-1c99670e651c642ae2b5a15c464ce7810653e18c.tar.gz dotfiles-1c99670e651c642ae2b5a15c464ce7810653e18c.tar.bz2 dotfiles-1c99670e651c642ae2b5a15c464ce7810653e18c.zip | |
Fixes for macOS
| -rwxr-xr-x | bash/.bashrc | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/bash/.bashrc b/bash/.bashrc index 25b7651..d9f3a6c 100755 --- a/bash/.bashrc +++ b/bash/.bashrc | |||
| @@ -24,14 +24,10 @@ case "$(uname)" in | |||
| 24 | alias ls="ls --color=auto" | 24 | alias ls="ls --color=auto" |
| 25 | usr="/usr" | 25 | usr="/usr" |
| 26 | ;; | 26 | ;; |
| 27 | FreeBSD) | 27 | FreeBSD|Darwin) |
| 28 | alias ls="ls -G" | 28 | alias ls="ls -G" |
| 29 | usr="/usr/local" | 29 | usr="/usr/local" |
| 30 | ;; | 30 | ;; |
| 31 | *) | ||
| 32 | alias ls="ls --color=auto" | ||
| 33 | usr="/usr" | ||
| 34 | ;; | ||
| 35 | esac | 31 | esac |
| 36 | 32 | ||
| 37 | # Colorfull manpages | 33 | # Colorfull manpages |
| @@ -91,10 +87,10 @@ elif exists vi; then | |||
| 91 | fi | 87 | fi |
| 92 | 88 | ||
| 93 | vim() { | 89 | vim() { |
| 94 | vim_bin=$(whereis -b -B $(sed "s/:/ /g" <(echo $PATH)) -f $EDITOR | cut -d' ' -f2-) | 90 | vim_bin=$(which $EDITOR) |
| 95 | if [[ -z $@ ]]; then | 91 | if [[ -z "$@" ]]; then |
| 96 | $vim_bin | 92 | $vim_bin |
| 97 | elif [[ -d $@ ]]; then | 93 | elif [[ -d "$@" ]]; then |
| 98 | dir=$(pwd) | 94 | dir=$(pwd) |
| 99 | cd $@ && $vim_bin && cd $dir | 95 | cd $@ && $vim_bin && cd $dir |
| 100 | else | 96 | else |
| @@ -109,8 +105,8 @@ if exists go; then | |||
| 109 | fi | 105 | fi |
| 110 | 106 | ||
| 111 | if exists gem; then | 107 | if exists gem; then |
| 112 | export GEM_HOME="$(ruby -e 'print Gem.user_dir')/bin" | 108 | export GEM_HOME="$(ruby -e 'print Gem.user_dir')" |
| 113 | export PATH="$PATH:$GEM_HOME" | 109 | export PATH="$PATH:$GEM_HOME/bin" |
| 114 | fi | 110 | fi |
| 115 | 111 | ||
| 116 | # Ezjail shortcuts | 112 | # Ezjail shortcuts |
| @@ -122,8 +118,7 @@ fi | |||
| 122 | 118 | ||
| 123 | # Showbanned ipadresses | 119 | # Showbanned ipadresses |
| 124 | if exists pfctl && exists sudo; then | 120 | if exists pfctl && exists sudo; then |
| 125 | showbanned () | 121 | showbanned () { |
| 126 | { | ||
| 127 | for table in "fail2ban" "permaban"; do | 122 | for table in "fail2ban" "permaban"; do |
| 128 | banned=$(sudo pfctl -t $table -T show 2> /dev/null) | 123 | banned=$(sudo pfctl -t $table -T show 2> /dev/null) |
| 129 | 124 | ||
| @@ -151,7 +146,7 @@ fi | |||
| 151 | # Set the virtualenv parameters | 146 | # Set the virtualenv parameters |
| 152 | if exists virtualenvwrapper.sh; then | 147 | if exists virtualenvwrapper.sh; then |
| 153 | export WORKON_HOME=$HOME/.virtualenvs | 148 | export WORKON_HOME=$HOME/.virtualenvs |
| 154 | source $use/bin/virtualenvwrapper.sh | 149 | source $(which virtualenvwrapper.sh) 2> /dev/null |
| 155 | fi | 150 | fi |
| 156 | 151 | ||
| 157 | # Start gnome-keyring-daemon | 152 | # Start gnome-keyring-daemon |
| @@ -164,7 +159,7 @@ fi | |||
| 164 | 159 | ||
| 165 | # Fancy bash prompt | 160 | # Fancy bash prompt |
| 166 | if exists liquidprompt; then | 161 | if exists liquidprompt; then |
| 167 | source liquidprompt | 162 | source $(which liquidprompt) 2> /dev/null |
| 168 | fi | 163 | fi |
| 169 | 164 | ||
| 170 | # Fancy system info | 165 | # Fancy system info |
| @@ -174,4 +169,4 @@ elif exists screenfetch; then | |||
| 174 | screenfetch | 169 | screenfetch |
| 175 | fi | 170 | fi |
| 176 | 171 | ||
| 177 | # vim: set ts=8 sw=8 tw=0 noet : | 172 | # vim: set ts=4 sw=4 tw=0 noet : |
