Up.
This commit is contained in:
parent
579c84dd5d
commit
15504184ac
@ -1,118 +0,0 @@
|
||||
#
|
||||
# common.lib
|
||||
#
|
||||
# Common libray for local scripts
|
||||
#
|
||||
|
||||
|
||||
|
||||
# CONSTANT VARIABLES
|
||||
RESET=$(tput sgr0)
|
||||
|
||||
F_BOLD=$(tput bold)
|
||||
F_UNDL=$(tput sgr 0 1)
|
||||
|
||||
C_BLK=$(tput setaf 0)
|
||||
C_RED=$(tput setaf 1)
|
||||
C_GRE=$(tput setaf 2)
|
||||
C_YEL=$(tput setaf 3)
|
||||
C_BLU=$(tput setaf 4)
|
||||
C_MAG=$(tput setaf 5)
|
||||
C_CYA=$(tput setaf 6)
|
||||
C_WHI=$(tput setaf 7)
|
||||
|
||||
# common errors will cause the script to
|
||||
# immediately fail, explicitly and loudly.
|
||||
set -euxo pipefail
|
||||
|
||||
# function used to display colored message
|
||||
cecho () {
|
||||
|
||||
declare -A colors;
|
||||
declare -A formats;
|
||||
|
||||
colors=(\
|
||||
['black']=$(tput setaf 0)\
|
||||
['red']=$(tput setaf 1)\
|
||||
['green']=$(tput setaf 2)\
|
||||
['yellow']=$(tput setaf 3)\
|
||||
['blue']=$(tput setaf 4)\
|
||||
['magenta']=$(tput setaf 5)\
|
||||
['cyan']=$(tput setaf 6)\
|
||||
['white']=$(tput setaf 7)\
|
||||
);
|
||||
|
||||
formats=(\
|
||||
['default']=$(tput sgr0)\
|
||||
['inverse']=$(tput smso)\
|
||||
['bold']=$(tput bold)\
|
||||
);
|
||||
|
||||
local defaultMSG="No message passed.";
|
||||
local defaultColor="white";
|
||||
local defaultFormat="default";
|
||||
local defaultNewLine=true;
|
||||
|
||||
while [[ $# -gt 1 ]];
|
||||
do
|
||||
key="$1";
|
||||
|
||||
case $key in
|
||||
-c|--color)
|
||||
color="$2";
|
||||
shift;
|
||||
;;
|
||||
-f|--format)
|
||||
format="$2";
|
||||
shift;
|
||||
;;
|
||||
-n|--noline)
|
||||
newLine=false;
|
||||
;;
|
||||
*)
|
||||
# unknown option
|
||||
;;
|
||||
esac
|
||||
shift;
|
||||
done
|
||||
|
||||
color=${color:-$defaultColor}; # Defaults to default color, if not specified.
|
||||
format=${format:-$defaultFormat}; # Defaults to default color, if not specified.
|
||||
newLine=${newLine:-$defaultNewLine};
|
||||
message=${1:-$defaultMSG}; # Defaults to default message.
|
||||
|
||||
echo -en "${formats[$format]}${colors[$color]}";
|
||||
echo -en "$message";
|
||||
if [ "$newLine" = true ] ; then
|
||||
echo;
|
||||
fi
|
||||
tput sgr0; # Reset text attributes to normal without clearing screen.
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
info1() {
|
||||
cecho -c 'blue' -f 'bold' "$@";
|
||||
}
|
||||
|
||||
info2() {
|
||||
cecho -c 'cyan' -f 'bold' "$@";
|
||||
}
|
||||
|
||||
success() {
|
||||
cecho -c 'green' "$@";
|
||||
}
|
||||
|
||||
error() {
|
||||
cecho -c 'red' -f 'bold' "$@";
|
||||
}
|
||||
|
||||
warning() {
|
||||
cecho -c 'yellow' "$@";
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* vim: set filetype=bash : */
|
@ -1,111 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Load local library
|
||||
. ./common.lib
|
||||
|
||||
|
||||
|
||||
packages=(
|
||||
curl
|
||||
direnv
|
||||
ranger
|
||||
tmux
|
||||
trash-cli
|
||||
unzip
|
||||
wget
|
||||
zip
|
||||
zoxide
|
||||
)
|
||||
|
||||
{{ if (eq .chezmoi.osRelease.id "manjaro" "arch") -}}
|
||||
|
||||
info1 ">>>>> Begin Arch/Manjaro Linux packages installation <<<<<"
|
||||
|
||||
## Update system
|
||||
{{- if ne .chezmoi.username "root" }}
|
||||
sudo pacman -Syu --noconfirm
|
||||
{{- else }}
|
||||
pacman -Syu --noconfirm
|
||||
{{- end}}
|
||||
|
||||
## Install yay
|
||||
if [ ! $(command -v yay) ]; then
|
||||
info2 "installing yay"
|
||||
{{- if ne .chezmoi.username "root" }}
|
||||
sudo pacman -S --needed --noconfirm git base-devel
|
||||
{{- else}}
|
||||
pacman -S --needed --noconfirm git base-devel
|
||||
{{- end }}
|
||||
git clone https://aur.archlinux.org/yay.git /tmp/yay
|
||||
cd /tmp/yay
|
||||
makepkg -si --noconfirm
|
||||
rm -rf /tmp/yay
|
||||
fi
|
||||
|
||||
## Install packages
|
||||
for package in ${packages[@]}; do
|
||||
if [ "$(yay -Qq $package 2> /dev/null)" != $package ]; then
|
||||
info2 "installing ${package}..."
|
||||
yay -S --noconfirm $package
|
||||
fi
|
||||
done
|
||||
|
||||
info1 ">>>>> Finish Arch/Manjaro Linux packages installation <<<<<"
|
||||
|
||||
{{ else if (eq .chezmoi.osRelease.id "debian" "ubuntu") -}}
|
||||
|
||||
info1 ">>>>> Begin Debian/Ubuntu Linux packages installation <<<<<"
|
||||
|
||||
DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
## Add repositories and update system
|
||||
{{- if ne .chezmoi.username "root" }}
|
||||
sudo -E apt-get install --yes --no-install-recommends --ignore-missing lsb-release gpg
|
||||
curl -fsSL 'https://proget.makedeb.org/debian-feeds/makedeb.pub' | gpg --dearmor | sudo tee /usr/share/keyrings/makedeb-archive-keyring.gpg 1> /dev/null
|
||||
echo 'deb [signed-by=/usr/share/keyrings/makedeb-archive-keyring.gpg arch=all] https://proget.makedeb.org/ makedeb main' | sudo tee /etc/apt/sources.list.d/makedeb.list
|
||||
curl -fsSL 'https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub' | gpg --dearmor | sudo tee /usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg 1> /dev/null
|
||||
echo "deb [arch=all,$(dpkg --print-architecture) signed-by=/usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg] https://proget.makedeb.org prebuilt-mpr $(lsb_release -cs)" | sudo tee /etc/apt/sources.list.d/prebuilt-mpr.list
|
||||
sudo -E apt update
|
||||
sudo -E apt upgrade --yes
|
||||
sudo -E apt-get install --yes --no-install-recommends --ignore-missing mist
|
||||
{{- else }}
|
||||
apt-get install --yes --no-install-recommends --ignore-missing lsb-release gpg
|
||||
curl -fsSL 'https://proget.makedeb.org/debian-feeds/makedeb.pub' | gpg --dearmor | tee /usr/share/keyrings/makedeb-archive-keyring.gpg 1> /dev/null
|
||||
echo 'deb [signed-by=/usr/share/keyrings/makedeb-archive-keyring.gpg arch=all] https://proget.makedeb.org/ makedeb main' | tee /etc/apt/sources.list.d/makedeb.list
|
||||
curl -fsSL 'https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub' | gpg --dearmor | tee /usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg 1> /dev/null
|
||||
echo "deb [arch=all,$(dpkg --print-architecture) signed-by=/usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg] https://proget.makedeb.org prebuilt-mpr $(lsb_release -cs)" | tee /etc/apt/sources.list.d/prebuilt-mpr.list
|
||||
apt update
|
||||
apt upgrade --yes
|
||||
apt-get install --yes --no-install-recommends --ignore-missing mist
|
||||
{{- end}}
|
||||
|
||||
mist update
|
||||
|
||||
## Install packages
|
||||
packages=(${packages[@]//starship/makedeb})
|
||||
packages+=(
|
||||
apt-utils
|
||||
autoconf
|
||||
automake
|
||||
cmake
|
||||
doxygen
|
||||
libtool
|
||||
libtool-bin
|
||||
ninja-build
|
||||
pkg-config
|
||||
)
|
||||
|
||||
for package in ${packages[@]}; do
|
||||
info2 "installing ${package}..."
|
||||
|
||||
{{- if ne .chezmoi.username "root" }}
|
||||
sudo -E apt-get install --yes --no-install-recommends --ignore-missing $package
|
||||
{{- else }}
|
||||
apt-get install --yes --no-install-recommends --ignore-missing $package
|
||||
{{- end }}
|
||||
done
|
||||
|
||||
info1 ">>>>> Finish Debian/Ubuntu Linux packages installation <<<<<"
|
||||
|
||||
{{- end }}
|
||||
|
@ -1,62 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Load local library
|
||||
. ./common.lib
|
||||
|
||||
|
||||
|
||||
ZIMDIR=${HOME}/.zim
|
||||
|
||||
|
||||
|
||||
packages=(
|
||||
starship
|
||||
zsh
|
||||
)
|
||||
|
||||
|
||||
|
||||
### Install Zsh ###
|
||||
info1 ">>>>> Begin Zsh installation <<<<<"
|
||||
|
||||
{{ if (eq .chezmoi.osRelease.id "manjaro" "arch") -}}
|
||||
|
||||
## install packages
|
||||
for package in ${packages[@]}; do
|
||||
if [ "$(yay -Qq $package 2> /dev/null)" != $package ]; then
|
||||
info2 "installing ${package}..."
|
||||
yay -S --noconfirm $package
|
||||
fi
|
||||
done
|
||||
|
||||
{{ else if (eq .chezmoi.osRelease.id "debian" "ubuntu") -}}
|
||||
DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
packages=(${packages[@]//starship/})
|
||||
|
||||
## install packages
|
||||
for package in ${packages[@]}; do
|
||||
info2 "installing ${package}..."
|
||||
|
||||
{{- if ne .chezmoi.username "root" }}
|
||||
sudo -E apt-get install --yes --no-install-recommends --ignore-missing $package
|
||||
{{- else }}
|
||||
apt-get install --yes --no-install-recommends --ignore-missing $package
|
||||
{{- end }}
|
||||
done
|
||||
|
||||
info2 "installing starship..."
|
||||
mist install starship-bin
|
||||
|
||||
{{- end }}
|
||||
|
||||
info1 ">>>>> Finish Zsh installation <<<<<"
|
||||
|
||||
|
||||
### Config Zsh ###
|
||||
info1 ">>>>> Installing Zim Framework <<<<<"
|
||||
|
||||
$(which zsh) -c "source ${ZIMDIR}/zimfw.zsh init -q"
|
||||
|
||||
info1 ">>>>> Finish zsh installation <<<<<"
|
||||
|
@ -1,73 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Load local library
|
||||
. ./common.lib
|
||||
|
||||
|
||||
|
||||
packages=(
|
||||
cargo
|
||||
go
|
||||
neovim
|
||||
npm
|
||||
python-pip
|
||||
python-pynvim
|
||||
ripgrep
|
||||
)
|
||||
|
||||
|
||||
|
||||
info1 ">>>>> Begin LVim installation <<<<<"
|
||||
|
||||
{{ if (eq .chezmoi.osRelease.id "manjaro" "arch") -}}
|
||||
|
||||
## Update system
|
||||
yay -Syu --noconfirm
|
||||
|
||||
## Install packages
|
||||
for package in ${packages[@]}; do
|
||||
if [ "$(yay -Qq $package 2> /dev/null)" != $package ]; then
|
||||
info2 "installing ${package}..."
|
||||
yay -S --noconfirm $package
|
||||
fi
|
||||
done
|
||||
|
||||
{{ else if (eq .chezmoi.osRelease.id "debian" "ubuntu") -}}
|
||||
|
||||
DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
## Update system
|
||||
{{- if ne .chezmoi.username "root" }}
|
||||
sudo -E apt update
|
||||
sudo -E apt upgrade --yes
|
||||
{{- else }}
|
||||
apt update
|
||||
apt upgrade --yes
|
||||
{{- end}}
|
||||
|
||||
## Install packages
|
||||
packages=(${packages[@]//go/golang})
|
||||
packages=(${packages[@]//python/python3})
|
||||
packages=(${packages[@]//neovim/})
|
||||
|
||||
for package in ${packages[@]}; do
|
||||
info2 "installing ${package}..."
|
||||
|
||||
{{- if ne .chezmoi.username "root" }}
|
||||
sudo -E apt-get install --yes --no-install-recommends --ignore-missing $package
|
||||
{{- else }}
|
||||
apt-get install --yes --no-install-recommends --ignore-missing $package
|
||||
{{- end }}
|
||||
done
|
||||
|
||||
info2 "installing neovim..."
|
||||
mist install neovim
|
||||
|
||||
{{- end }}
|
||||
|
||||
info2 "installing lvim..."
|
||||
LV_BRANCH='release-1.3/neovim-0.9' bash <(curl -s 'https://raw.githubusercontent.com/LunarVim/LunarVim/release-1.3/neovim-0.9/utils/installer/install.sh')
|
||||
|
||||
info1 ">>>>> Finish LVim installation <<<<<"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user