Skip to content

Instantly share code, notes, and snippets.

@elvitin
Last active February 27, 2024 18:41
Show Gist options
  • Save elvitin/7ba0c4119c9a7b0372ceff11f4065fbb to your computer and use it in GitHub Desktop.
Save elvitin/7ba0c4119c9a7b0372ceff11f4065fbb to your computer and use it in GitHub Desktop.
troca o tema do zsh
#!/bin/bash
# Caminho do arquivo ~/.zshrc
zshrc_file="$HOME/.zshrc"
# Verifica se o arquivo existe
if [ ! -f "$zshrc_file" ]; then
echo "Erro: O arquivo ~/.zshrc não existe."
exit 1
fi
# Verifica se o trecho ZSH_THEME="devcontainers" existe no arquivo
if ! grep -q 'ZSH_THEME="devcontainers"' "$zshrc_file"; then
echo "Erro: O trecho 'ZSH_THEME=\"devcontainers\"' não foi encontrado em ~/.zshrc"
exit 1
fi
# Substitui 'devcontainers' por 'random' no arquivo ~/.zshrc
sed -i 's/ZSH_THEME="devcontainers"/ZSH_THEME="random"/' "$zshrc_file"
echo "Substituição concluída: 'devcontainers' foi substituído por 'random' em ~/.zshrc"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment