Compare commits
2 Commits
db52edc6fd
...
d36d14ea98
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d36d14ea98
|
||
|
|
860092c100
|
@@ -1,6 +1,8 @@
|
|||||||
if ! command -v lsd &> /dev/null; then
|
if ! command -v lsd &> /dev/null; then
|
||||||
echo 'Installing lsd'
|
echo 'Installing lsd'
|
||||||
|
|
||||||
|
source $HOME/.zshenv
|
||||||
|
|
||||||
if [[ "$OSNAME" == "Linux" ]]; then
|
if [[ "$OSNAME" == "Linux" ]]; then
|
||||||
# Linux
|
# Linux
|
||||||
if [[ "$DISTRO_TYPE" == "debian" ]]; then
|
if [[ "$DISTRO_TYPE" == "debian" ]]; then
|
||||||
|
|||||||
50
.zshenv
Normal file
50
.zshenv
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
########## Personal - Determine OS and Set Variables ##########################
|
||||||
|
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||||
|
# Linux
|
||||||
|
OSNAME=Linux
|
||||||
|
|
||||||
|
if [ -f /etc/os-release ]; then
|
||||||
|
. /etc/os-release
|
||||||
|
DISTRO=$NAME
|
||||||
|
VER=$VERSION_ID
|
||||||
|
elif type lsb_release >/dev/null 2>&1; then
|
||||||
|
DISTRO=$(lsb_release -si)
|
||||||
|
VER=$(lsb_release -sr)
|
||||||
|
elif [ -f /etc/lsb-release ]; then
|
||||||
|
. /etc/lsb-release
|
||||||
|
DISTRO=$DISTRIB_ID
|
||||||
|
VER=$DISTRIB_RELEASE
|
||||||
|
elif [ -f /etc/debian_version ]; then
|
||||||
|
DISTRO=Debian
|
||||||
|
VER=$(cat /etc/debian_version)
|
||||||
|
else
|
||||||
|
# Fall back to uname
|
||||||
|
DISTRO=$(uname -s)
|
||||||
|
VER=$(uname -r)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if command -v dpkg &> /dev/null; then
|
||||||
|
# Debian-based
|
||||||
|
DISTRO_TYPE=debian
|
||||||
|
elif command -v yum &> /dev/null; then
|
||||||
|
# RPM-based
|
||||||
|
DISTRO_TYPE=rpm
|
||||||
|
elif command -v pacman &> /dev/null; then
|
||||||
|
# Arch-based
|
||||||
|
DISTRO_TYPE=arc
|
||||||
|
fi
|
||||||
|
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
|
# macOS
|
||||||
|
OSNAME=macOS
|
||||||
|
VER=$(sw_vers | grep ProductVersion | cut -c 17-)
|
||||||
|
else
|
||||||
|
# Fall back to uname
|
||||||
|
OSNAME=$(uname -s)
|
||||||
|
VER=$(uname -r)
|
||||||
|
fi
|
||||||
|
|
||||||
|
ARCH=$(uname -m)
|
||||||
|
|
||||||
|
export OSNAME DISTRO DISTRO_TYPE VER ARCH
|
||||||
|
|
||||||
|
|
||||||
50
.zshrc
50
.zshrc
@@ -7,56 +7,6 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
########## Personal - Determine OS and Set Variables ##########################
|
|
||||||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
|
||||||
# Linux
|
|
||||||
OSNAME=Linux
|
|
||||||
|
|
||||||
if [ -f /etc/os-release ]; then
|
|
||||||
. /etc/os-release
|
|
||||||
DISTRO=$NAME
|
|
||||||
VER=$VERSION_ID
|
|
||||||
elif type lsb_release >/dev/null 2>&1; then
|
|
||||||
DISTRO=$(lsb_release -si)
|
|
||||||
VER=$(lsb_release -sr)
|
|
||||||
elif [ -f /etc/lsb-release ]; then
|
|
||||||
. /etc/lsb-release
|
|
||||||
DISTRO=$DISTRIB_ID
|
|
||||||
VER=$DISTRIB_RELEASE
|
|
||||||
elif [ -f /etc/debian_version ]; then
|
|
||||||
DISTRO=Debian
|
|
||||||
VER=$(cat /etc/debian_version)
|
|
||||||
else
|
|
||||||
# Fall back to uname
|
|
||||||
DISTRO=$(uname -s)
|
|
||||||
VER=$(uname -r)
|
|
||||||
fi
|
|
||||||
|
|
||||||
if command -v dpkg &> /dev/null; then
|
|
||||||
# Debian-based
|
|
||||||
DISTRO_TYPE=debian
|
|
||||||
elif command -v yum &> /dev/null; then
|
|
||||||
# RPM-based
|
|
||||||
DISTRO_TYPE=rpm
|
|
||||||
elif command -v pacman &> /dev/null; then
|
|
||||||
# Arch-based
|
|
||||||
DISTRO_TYPE=arc
|
|
||||||
fi
|
|
||||||
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
|
||||||
# macOS
|
|
||||||
OSNAME=macOS
|
|
||||||
VER=$(sw_vers | grep ProductVersion | cut -c 17-)
|
|
||||||
else
|
|
||||||
# Fall back to uname
|
|
||||||
OSNAME=$(uname -s)
|
|
||||||
VER=$(uname -r)
|
|
||||||
fi
|
|
||||||
|
|
||||||
ARCH=$(uname -m)
|
|
||||||
|
|
||||||
export OSNAME DISTRO DISTRO_TYPE VER ARCH
|
|
||||||
|
|
||||||
|
|
||||||
########## Zinit ##############################################################
|
########## Zinit ##############################################################
|
||||||
### Added by Zinit's installerW
|
### Added by Zinit's installerW
|
||||||
if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then
|
if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user