#!/usr/bin/env bash set -x set -Eeu -o -pipefail # ND Do not put alias files in the script they are now in their own 020_script. sudo apt install -y zsh nodejs fzf chroma powerline-go # compaudit # There are insecure directories: /usr/local/share/zsh/site-functions # compaudit | xargs chmod g-w # compaudit 2>&1 | sed -n '1d; p' mkdir -p /usr/local/share/zsh/site-functions chmod g-w /usr/local/share/zsh/site-functions #DEST=$HOME DEST=${1:-/etc/skel} HOME="${DEST}" # KEY_DIR=/etc/apt/keyrings ALIAS_DIR=".zshrc.d" # Install zgenom plugin manager and zsh quickstart to get a default setup for zsh # .zgen-setup pulls zgenom automatically and puts it in .zqs-zgenom, plugins in .zgenom if [ ! -d "${DEST}/zsh-quickstart-kit" ]; then git clone https://github.com/unixorn/zsh-quickstart-kit "${DEST}"/zsh-quickstart-kit else echo "Quickstart kit already exists, skipping clone..." fi ln -rsf "${DEST}"/zsh-quickstart-kit/zsh/.zshrc "${DEST}/.zshrc" ln -rsf "${DEST}"/zsh-quickstart-kit/zsh/.zsh_functions "${DEST}/.zsh_functions" ln -rsf "${DEST}"/zsh-quickstart-kit/zsh/.zgen-setup "${DEST}/.zgen-setup" mkdir -p "${DEST}/${ALIAS_DIR}" echo "setopt PROMPT_SUBST" >>"${DEST}"/.zshrc echo "NVIM_PYTHON_LOG_FILE=/var/tmp/nvim_python.log" >>"${DEST}/${ALIAS_DIR}/008_nvim.zsh" echo "NVIM_PYTHON_LOG_LEVEL=DEBUG" >>"${DEST}/${ALIAS_DIR}/008_nvim.zsh" sudo touch /var/tmp/nvim_python.log # debians locate db locate # sed -i 's,^\(export LOCATE_PATH=\).*,\1'/var/lib/mlocate/mlocate.db',' "${DEST}"/.zshrc echo "export LOCATE_PATH=/var/lib/mlocate/mlocate.db" >"${DEST}/${ALIAS_DIR}/005_locatedb.zsh" # Create a file named .zgen-local-plugins and add your zgenom load commands there. # Don't forget to run `zgenom save` at the end of your .zgen-local-plugins file. # Warning: .zgen-local-plugins REPLACES the starter list setup, it doesn't add to it. # Comment out default docker plugin and replace with omz docker and compose plugins sed -i -e "s|zgenom load srijanshetty/docker-zsh|# zgenom load srijanshetty/docker-zsh|" "${DEST}/zsh-quickstart-kit/zsh/.zgen-setup" #sed -i '/\# zgenom load srijanshetty\/docker-zsh/a\ \ zgenom load ohmyzsh plugins\/docker\n\ \ zgenom load ohmyzsh plugins\/docker-compose' "${DEST}"/zsh-quickstart-kit/zsh/.zgen-setup conf_print_fzf() { cat <<'EOF' # zsh quickstart created this file if missing expecting fzf to be installed in ${HOME} # we have it installed via apt so the executables are in the path and the key-bindings # and completitions are in examples fom the package. # Setup fzf # --------- #if [[ ! "\$PATH" == *\${HOME}/.vim/bundle/fzf/bin/* ]]; then # export PATH="\$PATH:\${HOME}/.vim/bundle/fzf/bin" #fi # auto-completion # --------------- [[ \$- == *i* ]] && source "/usr/share/doc/fzf/examples/completion.zsh" 2> /dev/null # Key bindings # ------------ source "/usr/share/doc/fzf/examples/key-bindings.zsh" EOF } conf_print_fzf | tee "${DEST}/.fzf.zsh" # The contents of the starter plugin function with changes above, pulling from upstream git with now not squash local changes. conf_print_local_plugins() { cat <