From 066ff6c2f7561585248fe02c5492dd241fd3e19f Mon Sep 17 00:00:00 2001 From: Jeff LANCE Date: Fri, 1 Mar 2024 11:47:05 +0100 Subject: [PATCH] Up. --- ...onchange_after_10-install-packages.sh.tmpl | 13 +++++++--- .../run_onchange_after_20-config-zim.sh.tmpl | 26 ++++++++++++++++--- ...run_onchange_after_80-install-lvim.sh.tmpl | 16 ++++++++---- 3 files changed, 42 insertions(+), 13 deletions(-) diff --git a/home/.chezmoiscripts/run_onchange_after_10-install-packages.sh.tmpl b/home/.chezmoiscripts/run_onchange_after_10-install-packages.sh.tmpl index 793bde3..4923d41 100644 --- a/home/.chezmoiscripts/run_onchange_after_10-install-packages.sh.tmpl +++ b/home/.chezmoiscripts/run_onchange_after_10-install-packages.sh.tmpl @@ -2,9 +2,12 @@ # Logging function log() { - printf "$(tput setaf 4)$(tput bold)>>>>> %s <<<<<$(tput sgr0)" "$1" + printf "$(tput setaf 4)$(tput bold)>>>>> %s <<<<<$(tput sgr0)\n" "$1" } +inf() { + printf "$(tput setaf 2)$(tput sgr 0 1)%s$(tput sgr0)\n" "$1" +} # Packages to install @@ -25,6 +28,7 @@ packages=( log ">>>>> Begin Arch/Manjaro Linux packages installation <<<<<" ## Update system + inf "updating system..." {{- if ne .chezmoi.username "root" }} sudo pacman -Syu --noconfirm {{- else }} @@ -33,7 +37,7 @@ packages=( ## Install yay if [ ! $(command -v yay) ]; then - log "installing yay" + inf "installing yay..." {{- if ne .chezmoi.username "root" }} sudo pacman -S --needed --noconfirm git base-devel {{- else}} @@ -48,7 +52,7 @@ packages=( ## Install packages for package in ${packages[@]}; do if [ "$(yay -Qq $package 2> /dev/null)" != $package ]; then - log "installing ${package}..." + inf "installing ${package}..." yay -S --noconfirm $package fi done @@ -62,6 +66,7 @@ packages=( DEBIAN_FRONTEND=noninteractive ## Add repositories and update system + inf "updating 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 @@ -99,7 +104,7 @@ packages=( ) for package in ${packages[@]}; do - log "installing ${package}..." + inf "installing ${package}..." {{- if ne .chezmoi.username "root" }} sudo -E apt-get install --yes --no-install-recommends --ignore-missing $package diff --git a/home/.chezmoiscripts/run_onchange_after_20-config-zim.sh.tmpl b/home/.chezmoiscripts/run_onchange_after_20-config-zim.sh.tmpl index a244669..b028c8e 100644 --- a/home/.chezmoiscripts/run_onchange_after_20-config-zim.sh.tmpl +++ b/home/.chezmoiscripts/run_onchange_after_20-config-zim.sh.tmpl @@ -2,7 +2,11 @@ # Logging function log() { - printf "$(tput setaf 4)$(tput bold)>>>>> %s <<<<<$(tput sgr0)" "$1" + printf "$(tput setaf 4)$(tput bold)>>>>> %s <<<<<$(tput sgr0)\n" "$1" +} + +inf() { + printf "$(tput setaf 2)$(tput sgr 0 1)%s$(tput sgr0)\n" "$1" } @@ -23,10 +27,14 @@ log ">>>>> Begin Zsh installation <<<<<" {{ if (eq .chezmoi.osRelease.id "manjaro" "arch") -}} + ## Update system + inf "updating system..." + yay -Syu --noconfirm + ## install packages for package in ${packages[@]}; do if [ "$(yay -Qq $package 2> /dev/null)" != $package ]; then - log "installing ${package}..." + inf "installing ${package}..." yay -S --noconfirm $package fi done @@ -34,11 +42,21 @@ log ">>>>> Begin Zsh installation <<<<<" {{ else if (eq .chezmoi.osRelease.id "debian" "ubuntu") -}} DEBIAN_FRONTEND=noninteractive + ## Update system + inf "updating system..." + {{- if ne .chezmoi.username "root" }} + sudo -E apt update + sudo -E apt upgrade --yes + {{- else }} + apt update + apt upgrade --yes + {{- end}} + packages=(${packages[@]//starship/}) ## install packages for package in ${packages[@]}; do - log "installing ${package}..." + inf "installing ${package}..." {{- if ne .chezmoi.username "root" }} sudo -E apt-get install --yes --no-install-recommends --ignore-missing $package @@ -47,7 +65,7 @@ log ">>>>> Begin Zsh installation <<<<<" {{- end }} done - log "installing starship..." + inf "installing starship..." mist install starship-bin {{- end }} diff --git a/home/.chezmoiscripts/run_onchange_after_80-install-lvim.sh.tmpl b/home/.chezmoiscripts/run_onchange_after_80-install-lvim.sh.tmpl index 25a5a6d..10a7940 100644 --- a/home/.chezmoiscripts/run_onchange_after_80-install-lvim.sh.tmpl +++ b/home/.chezmoiscripts/run_onchange_after_80-install-lvim.sh.tmpl @@ -2,7 +2,11 @@ # Logging function log() { - printf "$(tput setaf 4)$(tput bold)>>>>> %s <<<<<$(tput sgr0)" "$1" + printf "$(tput setaf 4)$(tput bold)>>>>> %s <<<<<$(tput sgr0)\n" "$1" +} + +inf() { + printf "$(tput setaf 2)$(tput sgr 0 1)%s$(tput sgr0)\n" "$1" } @@ -25,12 +29,13 @@ log ">>>>> Begin LVim installation <<<<<" {{ if (eq .chezmoi.osRelease.id "manjaro" "arch") -}} ## Update system + inf "updating system..." yay -Syu --noconfirm ## Install packages for package in ${packages[@]}; do if [ "$(yay -Qq $package 2> /dev/null)" != $package ]; then - log "installing ${package}..." + inf "installing ${package}..." yay -S --noconfirm $package fi done @@ -40,6 +45,7 @@ log ">>>>> Begin LVim installation <<<<<" DEBIAN_FRONTEND=noninteractive ## Update system + inf "updating system..." {{- if ne .chezmoi.username "root" }} sudo -E apt update sudo -E apt upgrade --yes @@ -54,7 +60,7 @@ log ">>>>> Begin LVim installation <<<<<" packages=(${packages[@]//neovim/}) for package in ${packages[@]}; do - log "installing ${package}..." + inf "installing ${package}..." {{- if ne .chezmoi.username "root" }} sudo -E apt-get install --yes --no-install-recommends --ignore-missing $package @@ -63,12 +69,12 @@ log ">>>>> Begin LVim installation <<<<<" {{- end }} done - log "installing neovim..." + inf "installing neovim..." mist install neovim {{- end }} -log "installing lvim..." +inf "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') log ">>>>> Finish LVim installation <<<<<"