In order to test all oh-my-posh templates:
- Set in your
.zshrc
file:
source ~/test_script.sh
- Save the script to the file
~/test_script.sh
#!/bin/zsh
eval "$(oh-my-posh --init --shell zsh --config $(readlink ~/.linked_template))"
ZSH_PID=$$
(sleep 1 && kill -9 $ZSH_PID) &
- Evaluate the script
for theme in /opt/homebrew/opt/oh-my-posh/themes/*; do echo ""; echo ""; echo ""; echo $theme; ln -sf $theme ~/.linked_template; zsh; echo ""; echo ""; done; rm -f ~/test_script.sh
- Roll back
.zshrc
file
Remember to have the .zshrc
file open in the editor on the side. You may not login into your shell unless you revert changes in your .zshrc
.