Skip to content

Commit

Permalink
zshrc fix
Browse files Browse the repository at this point in the history
  • Loading branch information
m0ngr31 committed Feb 1, 2024
1 parent b95bbaa commit 4866703
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions config/files/usr/etc/skel/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ if [ -n "$CONTAINER_ID" ]; then
SETUP_DONE="$XDG_CONFIG_HOME/setup-done"

if ! [ -f "$SETUP_DONE" ]; then
echo 'Running initial setup...'
if [ -n "$SETUP_DEV_TOOLS" ]; then
echo 'Running initial setup...'

# Install oh-my-zsh
git clone https://github.com/ohmyzsh/ohmyzsh.git "$XDG_CONFIG_HOME/oh-my-zsh"
cp $XDG_CONFIG_HOME/oh-my-zsh/templates/zshrc.zsh-template "$XDG_CONFIG_HOME/.zshrc"
sed -i 's/export ZSH=\$HOME\/.oh-my-zsh/export ZSH=\$XDG_CONFIG_HOME\/oh-my-zsh/' "$XDG_CONFIG_HOME/.zshrc"
# Install oh-my-zsh
git clone https://github.com/ohmyzsh/ohmyzsh.git "$XDG_CONFIG_HOME/oh-my-zsh"
cp $XDG_CONFIG_HOME/oh-my-zsh/templates/zshrc.zsh-template "$XDG_CONFIG_HOME/.zshrc"
sed -i 's/export ZSH=\$HOME\/.oh-my-zsh/export ZSH=\$XDG_CONFIG_HOME\/oh-my-zsh/' "$XDG_CONFIG_HOME/.zshrc"

# Spaceship theme
ZSH_CUSTOM="$XDG_CONFIG_HOME/oh-my-zsh/custom"
git clone https://github.com/denysdovhan/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt" --depth=1
ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme"
sed -i 's/^ZSH_THEME="robbyrussell"/ZSH_THEME="spaceship"/' "$XDG_CONFIG_HOME/.zshrc"
# Spaceship theme
ZSH_CUSTOM="$XDG_CONFIG_HOME/oh-my-zsh/custom"
git clone https://github.com/denysdovhan/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt" --depth=1
ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme"
sed -i 's/^ZSH_THEME="robbyrussell"/ZSH_THEME="spaceship"/' "$XDG_CONFIG_HOME/.zshrc"

if [ -n "$SETUP_DEV_TOOLS" ]; then
# nvm
nvm_setup='[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion'
Expand All @@ -45,14 +45,16 @@ if [ -n "$CONTAINER_ID" ]; then
"$PYENV_ROOT/bin/pyenv" install 3.10.13; "$PYENV_ROOT/bin/pyenv" install 2.7.18
"$PYENV_ROOT/bin/pyenv" virtualenv 2.7.18 local2
"$PYENV_ROOT/bin/pyenv" global 3.10.13 local2
fi

echo 1 > "$SETUP_DONE"
echo 1 > "$SETUP_DONE"
fi
fi

source "$XDG_CONFIG_HOME/.zshrc"
unset SETUP_DONE

if [ -f "$XDG_CONFIG_HOME/.zshrc" ]; then
source "$XDG_CONFIG_HOME/.zshrc"
fi

db_glob_pattern="$XDG_CONFIG_HOME/config.d/*.zsh"

if stat -t "$db_glob_pattern" >/dev/null 2>&1; then
Expand Down

0 comments on commit 4866703

Please sign in to comment.