Skip to content

🎨 Powerlevel10k Script¢

This script adds the Powerlevel10k theme to your .zshrc if it is not already present, and reloads your Zsh configuration. It is intended for macOS systems using Homebrew.


πŸ› οΈ FeaturesΒΆ

  • Checks if Powerlevel10k is already sourced in .zshrc
  • Appends the theme source line if missing
  • Reloads .zshrc to apply changes immediately
  • Provides user feedback in German

powerlevel10k.sh
1
2
3
4
5
6
7
8
9
#!/usr/bin/env zsh

if ! grep -Fxq "source /opt/homebrew/share/powerlevel10k/powerlevel10k.zsh-theme" ~/.zshrc; then
  echo 'source /opt/homebrew/share/powerlevel10k/powerlevel10k.zsh-theme' >> ~/.zshrc
  echo "Powerlevel10k wurde zur .zshrc hinzugefΓΌgt." # (1)!
  source ~/.zshrc
else
  echo "Powerlevel10k ist bereits in der .zshrc eingetragen."
fi
  1. β†’ Starts the script with Zsh (ensures Zsh is used).

πŸš€ UsageΒΆ

zsh assets/scripts/powerLevel10.sh
  • Run in a Zsh shell on macOS with Powerlevel10k installed via Homebrew

⚠️ Notes¢

  • Only modifies .zshrc if the theme is not already present
  • Assumes Powerlevel10k is installed at /opt/homebrew/share/powerlevel10k/powerlevel10k.zsh-theme

πŸ”— ReferencesΒΆ

Share on Social Media