Added OMP to .zshrc
This commit is contained in:
parent
48a1b496d3
commit
ce41d504c3
1 changed files with 31 additions and 0 deletions
31
.zshrc
31
.zshrc
|
@ -2,3 +2,34 @@
|
|||
#
|
||||
# Colored ls
|
||||
alias ls=ls --color=auto
|
||||
#
|
||||
# Detect Device Arch
|
||||
arch="$(uname -m | tr '[:upper:]' '[:lower:]')"
|
||||
|
||||
case "${arch}" in
|
||||
x86_64) arch="amd64" ;;
|
||||
armv*) arch="arm" ;;
|
||||
arm64) arch="arm64" ;;
|
||||
aarch64) arch="arm64" ;;
|
||||
i686) arch="386" ;;
|
||||
esac
|
||||
|
||||
if [ "${arch}" = "arm64" ] && [ "$(getconf LONG_BIT)" -eq 32 ]; then
|
||||
arch=arm
|
||||
fi
|
||||
#
|
||||
# Detect Device Platform
|
||||
platform="$(uname -s | awk '{print tolower($0)}')"
|
||||
|
||||
case "${platform}" in
|
||||
linux) platform="linux" ;;
|
||||
darwin) platform="darwin" ;;
|
||||
esac
|
||||
#
|
||||
# Get and download the correct OMP
|
||||
correct_omp="~/.config/oh-my-posh/posh-$platform-$arch"
|
||||
if [ ! -f "$correct_omp" ]; then
|
||||
echo "Downloading Oh My Posh for $platform-$arch"
|
||||
curl -s -o "$correct_omp" "https://github.com/JanDeDobbeleer/oh-my-posh/releases/download/latest/posh-$platform-$arch"
|
||||
fi
|
||||
alias oh-my-posh="$correct_omp"
|
||||
|
|
Loading…
Add table
Reference in a new issue