mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-06 13:39:41 +00:00
cca2660c3b
* increase synergy between scripts * Fix newlines Fix packagers etc * fix an issue with no new line being created * fix formatting Co-authored-by: Adam Perkowski <adas1per@protonmail.com> * fix extra comma Co-authored-by: Adam Perkowski <adas1per@protonmail.com> * change to () Co-authored-by: Adam Perkowski <adas1per@protonmail.com> * change to () Co-authored-by: Adam Perkowski <adas1per@protonmail.com> * change to () Co-authored-by: Adam Perkowski <adas1per@protonmail.com> * change to () Co-authored-by: Adam Perkowski <adas1per@protonmail.com> * remove extra comma Co-authored-by: Adam Perkowski <adas1per@protonmail.com> * remove "please" Co-authored-by: Adam Perkowski <adas1per@protonmail.com> * add support for caps Co-authored-by: Adam Perkowski <adas1per@protonmail.com> * add support for caps Co-authored-by: Adam Perkowski <adas1per@protonmail.com> * add support for caps Co-authored-by: Adam Perkowski <adas1per@protonmail.com> * remove \n and make the default option "N" Co-authored-by: Adam Perkowski <adas1per@protonmail.com> * add an extra quote Co-authored-by: Adam Perkowski <adas1per@protonmail.com> * add extra quotes * fix remaining sn * fix remaining new lines --------- Co-authored-by: nnyyxxxx <nnyyxxxx@users.noreply.github.com> Co-authored-by: Adam Perkowski <adas1per@protonmail.com>
54 lines
1.3 KiB
Bash
54 lines
1.3 KiB
Bash
#!/bin/sh
|
|
|
|
. ../common-script.sh
|
|
|
|
# Function to install zsh
|
|
installZsh() {
|
|
if ! command_exists zsh; then
|
|
printf "%b\n" "${YELLOW}Installing Zsh...${RC}"
|
|
case "$PACKAGER" in
|
|
pacman)
|
|
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm zsh
|
|
;;
|
|
*)
|
|
"$ESCALATION_TOOL" "$PACKAGER" install -y zsh
|
|
;;
|
|
esac
|
|
else
|
|
printf "%b\n" "${GREEN}ZSH is already installed.${RC}"
|
|
fi
|
|
}
|
|
|
|
# Function to setup zsh configuration
|
|
setupZshConfig() {
|
|
printf "%b\n" "${YELLOW}Setting up Zsh configuration...${RC}"
|
|
CONFIG_DIR="$HOME/.config/zsh"
|
|
ZSHRC_FILE="$CONFIG_DIR/.zshrc"
|
|
|
|
if [ ! -d "$CONFIG_DIR" ]; then
|
|
mkdir -p "$CONFIG_DIR"
|
|
fi
|
|
|
|
# Write the configuration to .zshrc
|
|
cat <<EOL >"$ZSHRC_FILE"
|
|
HISTFILE=~/.config/zsh/.histfile
|
|
HISTSIZE=5000
|
|
SAVEHIST=100000
|
|
setopt autocd extendedglob
|
|
unsetopt beep
|
|
bindkey -v
|
|
|
|
# Configure the prompt with embedded Solarized color codes
|
|
PROMPT='%F{32}%n%f%F{166}@%f%F{64}%m:%F{166}%~%f%F{15}$%f '
|
|
RPROMPT='%F{15}(%F{166}%D{%H:%M}%F{15})%f'
|
|
EOL
|
|
|
|
# Ensure /etc/zsh/zshenv sets ZDOTDIR to the user's config directory
|
|
echo "export ZDOTDIR=\"$HOME/.config/zsh\"" | "$ESCALATION_TOOL" tee -a /etc/zsh/zshenv
|
|
}
|
|
|
|
checkEnv
|
|
checkEscalationTool
|
|
installZsh
|
|
setupZshConfig
|