From 2b398cea3a9480faf90873ffee9dadf3acaf49cd Mon Sep 17 00:00:00 2001 From: Lara Date: Wed, 19 Feb 2020 12:14:43 -0500 Subject: [PATCH] [zsh] Add support for macos --- aliases | 8 ++++++-- install.sh | 5 +++-- zshrc | 11 +++++++++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/aliases b/aliases index adc3c51..53576e7 100644 --- a/aliases +++ b/aliases @@ -20,13 +20,18 @@ if which sl > /dev/null 2>&1; then alias l='sl' alias lll='sl' fi -case $(lsb_release -i | awk -F ':\t' '/Distributor ID/{print $2}') in +case $(uname -s) in Arch) + alias redwm='cd ~/aur/dwm-git; updpkgsums; makepkg -fi --noconfirm; killall dwm' alias upgrade='sudo pacman -Syu';; Debian|Ubuntu) alias upgrade='sudo apt-get update && sudo apt-get -dy dist-upgrade && sudo apt-get dist-upgrade';; VoidLinux) alias upgrade='sudo xbps-install -Su';; + Darwin) + if which mvim > /dev/null 2>&1; then + alias vim='mvim -v' + fi;; esac alias ll='ls -lha' alias df='df -h' @@ -43,7 +48,6 @@ alias -g .......='../../../../../..' alias -g ........='../../../../../../..' # Hackish tweaks alias steam-wine="WINEDEBUG=-all wine $WINEPREFIX/drive_c/Program\ Files\ \(x86\)/Steam/Steam.exe -no-dwrite -no-cef-sandbox &" -alias redwm='cd ~/aur/dwm-git; updpkgsums; makepkg -fi --noconfirm; killall dwm' alias minecraft='java -jar $HOME/.minecraft/launcher.jar' alias rot13="tr '[A-Za-z]' '[N-ZA-Mn-za-m]'" alias shuffle='mpv --shuffle --display-tags= --no-audio-display' diff --git a/install.sh b/install.sh index dd603bf..ff962f2 100755 --- a/install.sh +++ b/install.sh @@ -1,7 +1,8 @@ #!/bin/sh -SCRIPT=$(readlink -f "$0") -RC_PATH=$(dirname "$SCRIPT") +#SCRIPT=$(readlink -f "$0") +#RC_PATH=$(dirname "$SCRIPT") +RC_PATH=$(cd "$(dirname "$0")"; pwd) HOST=$(hostname) XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-$HOME/.config} XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share} diff --git a/zshrc b/zshrc index 86afd45..c63e0b6 100644 --- a/zshrc +++ b/zshrc @@ -10,14 +10,21 @@ # Uncomment this line for perfomance analysis #zmodload zsh/zprof +export PATH="$PATH:/Library/Frameworks/Python.framework/Versions/3.8/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/sbin" # Get rc dir path -RC_PATH=$(dirname "$(readlink -f ${(%):-%x})") +#RC_PATH=$(dirname "$(readlink -f ${(%):-%x})") +# https://stackoverflow.com/questions/9901210/bash-source0-equivalent-in-zsh#comment45012039_23259585 +RC_PATH=$(dirname "$(realpath -- "${(%):-%x}")") +export PATH="$PATH:$RC_PATH/bin:~/bin:/opt/cuda/bin:~/.cargo/bin:~/go/bin" -export PATH="$PATH:/usr/local/sbin:/usr/sbin:/sbin:$RC_PATH/bin:~/bin:/opt/cuda/bin:~/.cargo/bin:~/go/bin" # Add ruby gems to path if which ruby >/dev/null && which gem >/dev/null; then PATH="$(ruby -r rubygems -e 'puts Gem.user_dir')/bin:$PATH" fi +# Add emscripten to path +if [ -d "$HOME/emsdk" ]; then + PATH="$PATH:~/emsdk:~/emsdk/node/12.9.1_64bit/bin:~/emsdk/fastcomp/emscripten" #:~/emsdk/fastcomp/emscripten/tools" +fi export BROWSER='/usr/bin/w3m -T "text/html"' export EDITOR=/usr/bin/vim export GPG_TTY="$(tty)"