diff --git a/dotfiles/aliases b/dotfiles/aliases index 17d8fbb..800582f 100755 --- a/dotfiles/aliases +++ b/dotfiles/aliases @@ -8,10 +8,13 @@ alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo alias luksFormat='cryptsetup luksFormat -s 512 -c aes-xts-plain64 -h sha256 -i 15000' # Colors -alias ls='ls --color=auto' -alias grep='grep --color=auto' -alias egrep='egrep --color=auto' -alias fgrep='fgrep --color=auto' +if [ `uname` != 'Darwin' ] ; then + # Should have a better way to check for GNU versions + alias ls='ls --color=auto' + alias grep='grep --color=auto' + alias egrep='egrep --color=auto' + alias fgrep='fgrep --color=auto' +fi # Easy upgrade alias dist-upgrade="sudo sh -c 'apt-get update && apt-get -y dist-upgrade'" diff --git a/dotfiles/zshrc b/dotfiles/zshrc index 243edc6..1d5f4b6 100755 --- a/dotfiles/zshrc +++ b/dotfiles/zshrc @@ -20,9 +20,13 @@ esac autoload -U colors && colors PS1="%{$fg[black]%}[%{$fg[yellow]%}%h%{$fg[black]%}] %{%(!.$fg[red].$fg[green])%}%8>..>%n%>>%{$fg[white]%}@%{$fg[blue]%}%12>..>%m%>>%{$fg[white]%}:%{$fg[green]%}%32<...<%~%<<%{$fg[white]%}%#%{$reset_color%} " -# LS Colors -alias ls='ls --color' -zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} +if [ `uname` != 'Darwin' ] ; then + # ls Colors + alias ls='ls --color' + zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} +else + alias ls='ls -G' +fi # Load oh-my-zsh if [ -d $HOME/.oh-my-zsh ] ; then diff --git a/install.sh b/install.sh index cc30a80..b03ed89 100755 --- a/install.sh +++ b/install.sh @@ -3,6 +3,13 @@ set -o nounset set -o errexit +FINDTYPE="-xtype" + +if [ `uname` == 'Darwin' ] ; then + # MacOS specifics + FINDTYPE="-type" +fi + function prerequisites { if which zsh > /dev/null 2>&1 ; then if [[ $- == *i* ]] ; then @@ -30,7 +37,7 @@ function install_dotfile_dir { -name install.sh -o \ -name README.md -o \ -name .gitignore \) \ - -prune -o -xtype f -print | \ + -prune -o ${FINDTYPE} f -print | \ while read dotfile ; do local TARGET="${HOME}/.${dotfile#${SRCDIR}/}" mkdir -p `dirname "${TARGET}"` @@ -42,7 +49,7 @@ function install_basic_dir { local SRCDIR="${1}" local DESTDIR="${2}" local file - find "${SRCDIR}" -xtype f -print | \ + find "${SRCDIR}" ${FINDTYPE} f -print | \ while read file ; do local TARGET="${2}/${file#${SRCDIR}/}" mkdir -p `dirname "${TARGET}"`