Created
November 9, 2012 19:13
-
-
Save mmacedo/4047615 to your computer and use it in GitHub Desktop.
Preview oh-my-zsh themes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Backup and modify .zshrc | |
cp $HOME/.zshrc $HOME/.zshrc_ | |
sed -i "s/^ZSH_THEME=/\# \0/" $HOME/.zshrc | |
echo >> $HOME/.zshrc | |
echo "echo \"\\n\\n\\033[1;31m\$ZSH_THEME\\033[0m\\n\\n\"" >> $HOME/.zshrc | |
# Using xterm | |
CMD="xterm -ls -e /usr/bin/env zsh" | |
# Iterate theme files in the .oh-my-zsh/themes | |
for theme in $( ls $HOME/.oh-my-zsh/themes | cut -d. -f1 ) | |
do | |
ZSH_THEME="$theme" $CMD & | |
# Keep only four emulators open at a time | |
while [ $( echo "$(jobs)" | grep Running | wc -l ) -ge 4 ]; do sleep 1; done | |
done | |
# Wait last four to be closed | |
wait | |
# Restore .zshrc | |
mv $HOME/.zshrc_ $HOME/.zshrc |
Thank you very much.
This saved me the heck of a lot of time.
Thumbs up !!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome script. Helped me find a theme I've been looking for for months.