A zsh configuration installer that attempts to set up a nice terminal environment across different platforms. Originally created for my own use, but might be helpful for others.
β οΈ Note: This is a relatively new rewrite (v2.0.0) and needs more real-world testing across different environments. If you encounter issues, please open an issue or contribute a fix!
- Attempts to run multiple times without breaking things (idempotent)
- Backs up existing configurations automatically
- Includes error handling and validation
- Dry-run mode to see what would happen
- macOS (with Homebrew)
- Linux (Ubuntu/Debian, Fedora, Arch)
- WSL1/WSL2 with Windows integration attempts
Note: Primarily tested on WSL/Ubuntu. Other platforms need more testing.
- Zsh - Shell with nice features
- Oh My Zsh - Framework for managing zsh
- Powerlevel10k - Fast, customizable prompt theme
- Plugins:
- Nerd Fonts - MesloLGS NF for icons
- Optional: Kubernetes tools (kubectl, helm, kubectx, kubens)
- Command-line flags for selective installation
- Environment variables for configuration
- Non-interactive mode for automation
β οΈ Recommended: Run with--dry-runfirst to see what it will do!
git clone https://github.com/jesposito/my-zsh-setup.git
cd my-zsh-setup
./setup.sh --dry-run./setup.sh./setup.sh --non-interactive- Git
- curl or wget
- One of:
apt,dnf,pacman, orbrew(Homebrew) - sudo access (for package installation)
./setup.sh [OPTIONS]| Option | Description |
|---|---|
-h, --help |
Show help message |
-v, --verbose |
Enable verbose output |
-n, --dry-run |
Preview changes without making them |
-y, --non-interactive |
Run without prompts (use defaults) |
--skip-omz |
Skip Oh My Zsh installation |
--skip-p10k |
Skip Powerlevel10k installation |
--skip-plugins |
Skip plugin installation |
--skip-fonts |
Skip font installation |
--skip-backup |
Skip backing up existing configs |
--install-k8s |
Install Kubernetes tools |
You can also configure the installer using environment variables:
# Disable specific components
INSTALL_OMZ=false ./setup.sh
# Install with Kubernetes tools
INSTALL_K8S_TOOLS=true ./setup.sh
# Verbose dry run
VERBOSE=true DRY_RUN=true ./setup.sh| Variable | Default | Description |
|---|---|---|
INSTALL_OMZ |
true |
Install Oh My Zsh |
INSTALL_P10K |
true |
Install Powerlevel10k |
INSTALL_PLUGINS |
true |
Install zsh plugins |
INSTALL_FONTS |
true |
Install Nerd Fonts |
INSTALL_K8S_TOOLS |
false |
Install Kubernetes tools |
SKIP_BACKUP |
false |
Skip configuration backups |
VERBOSE |
false |
Verbose output |
DRY_RUN |
false |
Dry run mode |
NON_INTERACTIVE |
false |
Non-interactive mode |
./setup.sh --skip-fonts./setup.sh --install-k8sINSTALL_FONTS=false INSTALL_K8S_TOOLS=false ./setup.sh --non-interactive./setup.sh --dry-run --verbose# Install only zsh with custom plugins, skip theme
INSTALL_P10K=false ./setup.sh --skip-fonts- Zsh - Modern shell with advanced features
- Oh My Zsh - Plugin and theme framework
- Powerlevel10k - Fast, customizable prompt theme
- MesloLGS NF Font - Nerd Font with icon support
git- Git integration and aliasesdocker- Docker command completiondocker-compose- Docker Compose integrationkubectl- Kubernetes CLI integration (if kubectl installed)npm- Node package manager shortcutsvscode- VSCode integrationzsh-syntax-highlighting- Fish-like syntax highlightingzsh-autosuggestions- Fish-like autosuggestions
.. # cd ..
... # cd ../..
.... # cd ../../..
~ # cd ~
home # cd ~ga # git add
gc # git commit
gcm # git commit -m
gp # git push
gl # git pull
gst # git status
gco # git checkout
glog # git log --oneline --graph --decoratedps # docker ps
dpa # docker ps -a
di # docker images
dlog # docker logs
dexec # docker exec -itk # kubectl
kx # kubectx
kns # kubensmkcd <dir>- Create directory and cd into itextract <file>- Extract various archive formatscode- Open VSCode (WSL-aware on Windows)open- Open Windows Explorer (WSL only)
- Uses Homebrew for package installation
- Installs fonts via Homebrew Cask
- Supports apt, dnf, and pacman
- Downloads fonts to
~/.local/share/fonts
- Automatically detects WSL environment
- Configures VSCode integration with Windows
- Sets up Windows Explorer integration
- Browser configuration for wslview
exec zshRun the configuration wizard:
p10k configureSet your terminal to use MesloLGS NF font:
- iTerm2 (macOS): Preferences β Profiles β Text β Font
- Terminal.app (macOS): Preferences β Profiles β Font
- Windows Terminal: Settings β Profiles β Appearance β Font face
- GNOME Terminal: Preferences β Profiles β Text β Custom font
Edit ~/.zshrc to add your personal customizations:
vim ~/.zshrc
# or
code ~/.zshrcThe installer automatically backs up existing configurations to:
~/.zsh-setup-backups/YYYYMMDD-HHMMSS/
# Find your backup
ls -la ~/.zsh-setup-backups/
# Restore
cp ~/.zsh-setup-backups/20260105-123456/.zshrc ~/.zshrc./setup.sh --skip-backupcd tests
./run_tests.shshellcheck setup.shbats tests/test_setup.batsbash -n setup.shbrew install shellcheck bats-coresudo apt install shellcheck batssudo dnf install ShellCheck batsContributions are very welcome! This script needs more testing across different environments and setups. If you:
- Find a bug β Open an issue
- Have a platform it doesn't work on β Please help test/fix it
- Want to add a feature β Pull requests appreciated
- Have improvement ideas β Let's discuss them
- Fork the repository
- Create your feature branch (
git checkout -b feature/your-feature) - Make your changes
- Test thoroughly (especially
./setup.sh --dry-run) - Run tests if possible (
./tests/run_tests.sh) - Commit your changes
- Push to the branch and open a Pull Request
Especially looking for testing on:
- macOS (Intel and Apple Silicon)
- Fedora/RHEL (dnf package manager)
- Arch Linux (pacman package manager)
- Different WSL versions and configurations
Even just trying it out and reporting success/failure helps!
After installation, you'll have:
~/.zshrc- Main zsh configuration~/.p10k.zsh- Powerlevel10k theme configuration~/.oh-my-zsh/- Oh My Zsh installation directory~/.zsh-setup-backups/- Backup directory
First, check your backups:
ls -la ~/.zsh-setup-backups/
# Restore if needed:
cp ~/.zsh-setup-backups/YYYYMMDD-HHMMSS/.zshrc ~/.zshrcManually set zsh as default:
chsh -s $(which zsh)- Make sure your terminal is using MesloLGS NF font
- Restart your terminal
- Run
p10k configureagain
Check that plugins are sourced in ~/.zshrc:
grep "plugins=" ~/.zshrcTry installing manually:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"Make sure the script is executable:
chmod +x setup.shPlease open an issue with:
- Your OS and version
- Error messages
- Output from
./setup.sh --verbose --dry-run
- Downloads are from official sources (Oh My Zsh, Powerlevel10k, etc.)
- Uses HTTPS for remote operations
- No credentials or sensitive data stored
- Always review scripts before running them!
- Use
--dry-runfirst to see what it will do
If you spot any security issues, please report them.
This project is licensed under the MIT License - see the LICENSE file for details.
This builds on the excellent work of:
- Oh My Zsh - Zsh framework
- Powerlevel10k - Prompt theme by romkatv
- zsh-users - Plugin authors
- Nerd Fonts - Font developers
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Originally created for my own use to quickly set up zsh on new machines. The v2.0.0 rewrite aimed to make it more portable and useful for others, but it still needs more testing across different environments.
If this helps you, great! If you find issues or have improvements, please contribute back.
Made by jesposito