Compare commits
4 Commits
b141fdc91e
...
cc4eb4f544
| Author | SHA1 | Date | |
|---|---|---|---|
| cc4eb4f544 | |||
| 0a659528a4 | |||
| 49b97d5697 | |||
| 0ba21d0238 |
@@ -4,7 +4,7 @@ Git repo of my personal shell profile variables
|
|||||||
### Quick Install
|
### Quick Install
|
||||||
|
|
||||||
```
|
```
|
||||||
curl https://gitlab.com/madumlao/madumlao-profile/-/raw/master/install.sh | bash
|
curl https://gitea.madumlao.com/madumlao/madumlao-profile/src/branch/master/install.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
### Manual Install
|
### Manual Install
|
||||||
|
|||||||
80
install-rhel.sh
Executable file
80
install-rhel.sh
Executable file
@@ -0,0 +1,80 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# run by install.sh
|
||||||
|
# tested on os-release 9,3
|
||||||
|
APP_DIR="$(dirname "$0")"
|
||||||
|
|
||||||
|
echo "Run an apt update"
|
||||||
|
if sudo -l dnf > /dev/null; then
|
||||||
|
sudo dnf check-update
|
||||||
|
else
|
||||||
|
echo "Unable to run dnf commands, please install manually"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Install git and friends"
|
||||||
|
if sudo -l apt > /dev/null; then
|
||||||
|
sudo dnf install -y git
|
||||||
|
else
|
||||||
|
echo "Unable to autoinstall git and friends, please install manually"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Install zsh and friends"
|
||||||
|
if sudo -l dnf > /dev/null; then
|
||||||
|
sudo dnf install -y zsh PackageKit-command-not-found sqlite
|
||||||
|
else
|
||||||
|
echo "Unable to autoinstall zsh and friends, please install manually"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Install oh-my-zsh and plugins"
|
||||||
|
if ! [ -d "$HOME/.oh-my-zsh" ]; then
|
||||||
|
git clone https://github.com/ohmyzsh/ohmyzsh "$HOME/.oh-my-zsh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
(
|
||||||
|
cd "$HOME/.oh-my-zsh/plugins"
|
||||||
|
git clone https://github.com/zsh-users/zsh-autosuggestions
|
||||||
|
git clone https://github.com/zsh-users/zsh-syntax-highlighting
|
||||||
|
)
|
||||||
|
|
||||||
|
echo "Changing default shell"
|
||||||
|
ZSH_PATH="$(which zsh)"
|
||||||
|
if [ -x "$ZSH_PATH" ]; then
|
||||||
|
if sudo -l chsh -s $ZSH_PATH $USER; then
|
||||||
|
sudo chsh -s $ZSH_PATH $USER
|
||||||
|
elif sudo -l usermod -s $ZSH_PATH $USER; then
|
||||||
|
sudo usermod -s $ZSH_PATH $USER
|
||||||
|
else
|
||||||
|
echo "Cannot change shell using sudo, trying password"
|
||||||
|
if ! chsh -s "$ZSH_PATH"; then
|
||||||
|
echo "Unable to change shell to $ZSH_PATH, please change shell manually"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "No zsh available"
|
||||||
|
fi
|
||||||
|
|
||||||
|
SKEL_DIR="$APP_DIR/skel"
|
||||||
|
BACK_DIR="$APP_DIR/backup"
|
||||||
|
|
||||||
|
echo "Backing up original profile under $BACK_DIR"
|
||||||
|
mkdir -pv "$BACK_DIR"
|
||||||
|
|
||||||
|
cd "$SKEL_DIR"
|
||||||
|
OLDIFS="$IFS"
|
||||||
|
IFS=$'\n'
|
||||||
|
for x in $(ls -a); do
|
||||||
|
[ "$x" = '.' ] || [ "$x" = '..' ] && continue;
|
||||||
|
[ "$x" = '.profile-local' ] || [ "$x" = '.profile-private' ] && continue;
|
||||||
|
[ -r "$HOME/$x" ] && echo -ne "Backup: " && mv -v "$HOME/$x" "$BACK_DIR"
|
||||||
|
echo -ne "Linking: " && ln -srv "$(pwd)/$x" "$HOME"
|
||||||
|
done
|
||||||
|
IFS="$OLDIFS"
|
||||||
|
|
||||||
|
echo "Install vim and friends"
|
||||||
|
if sudo -l apt > /dev/null; then
|
||||||
|
sudo dnf install -y vim-enhanced
|
||||||
|
else
|
||||||
|
echo "Unable to autoinstall vim and friends, please install manually"
|
||||||
|
fi
|
||||||
|
mkdir -pv "$HOME/.vim/bundle"
|
||||||
|
git clone https://github.com/VundleVim/Vundle.vim "$HOME/.vim/bundle/Vundle.vim"
|
||||||
|
vim +PluginInstall +qall
|
||||||
21
install.sh
21
install.sh
@@ -14,9 +14,9 @@ if [ "$DOWNLOAD_APP" ]; then
|
|||||||
mkdir -pv "$PARENT_DIR"
|
mkdir -pv "$PARENT_DIR"
|
||||||
if [ -x git ]; then
|
if [ -x git ]; then
|
||||||
cd "$PARENT_DIR"
|
cd "$PARENT_DIR"
|
||||||
git clone https://gitlab.com/madumlao/madumlao-profile
|
git clone https://gitea.madumlao.com/madumlao/madumlao-profile
|
||||||
else
|
else
|
||||||
curl -O https://gitlab.com/madumlao/madumlao-profile/-/archive/master/madumlao-profile-master.tar.gz
|
curl -o madumlao-profile-master.tar.gz https://gitea.madumlao.com/madumlao/madumlao-profile/archive/master.tar.gz
|
||||||
tar -zxf madumlao-profile-master.tar.gz -C "$PARENT_DIR"
|
tar -zxf madumlao-profile-master.tar.gz -C "$PARENT_DIR"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -26,8 +26,21 @@ cd "$APP_DIR"
|
|||||||
APP_DIR="$(pwd)"
|
APP_DIR="$(pwd)"
|
||||||
|
|
||||||
if [ "$(uname)" == "Linux" ]; then
|
if [ "$(uname)" == "Linux" ]; then
|
||||||
# TODO: add support for different distributions
|
# detect WSL
|
||||||
./install-ubuntu.sh
|
if uname -r | grep -q WSL > /dev/null; then
|
||||||
|
export PROFILE_WSL=y
|
||||||
|
fi
|
||||||
|
|
||||||
|
source /etc/os-release
|
||||||
|
export PROFILE_DISTRO="$ID"
|
||||||
|
export PROFILE_DISTRO_VERSION="$VERSION_ID"
|
||||||
|
export PROFILE_DISTRO_CODENAME="$VERSION_CODENAME"
|
||||||
|
export PROFILE_DISTRO_FAMILY="$ID_LIKE"
|
||||||
|
case "$PROFILE_DISTRO" in
|
||||||
|
ubuntu ) ./install-ubuntu.sh ;;
|
||||||
|
ol | rhel ) ./install-rhel.sh ;;
|
||||||
|
* ) echo "Unknown distro, install manually"
|
||||||
|
esac
|
||||||
elif [ "$(uname)" == "Darwin" ]; then
|
elif [ "$(uname)" == "Darwin" ]; then
|
||||||
echo TODO: install-macos.sh
|
echo TODO: install-macos.sh
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -89,10 +89,6 @@ PYENV_ROOT="${PYENV_ROOT:-${HOME}/.pyenv}"
|
|||||||
if [ -z "$PYENV_DISABLE" ] && [ -d "$PYENV_ROOT/bin" ]; then
|
if [ -z "$PYENV_DISABLE" ] && [ -d "$PYENV_ROOT/bin" ]; then
|
||||||
export PATH="$HOME/.pyenv/bin:$PATH"
|
export PATH="$HOME/.pyenv/bin:$PATH"
|
||||||
export PIPENV_VENV_IN_PROJECT=1
|
export PIPENV_VENV_IN_PROJECT=1
|
||||||
PYENV_MAJOR_VERSION="$(pyenv --version|cut -f 2 -d ' '|cut -f 1 -d .)"
|
|
||||||
if [ "$PYENV_MAJOR_VERSION" -gt 1 ]; then
|
|
||||||
eval "$(pyenv init --path)"
|
|
||||||
fi
|
|
||||||
eval "$(pyenv init -)"
|
eval "$(pyenv init -)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
|
emulate bash
|
||||||
source /etc/profile
|
source /etc/profile
|
||||||
|
emulate zsh
|
||||||
|
|
||||||
source $HOME/.profile
|
source $HOME/.profile
|
||||||
|
|
||||||
# source kubernetes shell completion
|
# source kubernetes shell completion
|
||||||
|
|||||||
Reference in New Issue
Block a user