Skip to content

Instantly share code, notes, and snippets.

@bajorekp
Created December 21, 2021 00:10
Show Gist options
  • Save bajorekp/3e49787b4741d7bb566027ffead5dc02 to your computer and use it in GitHub Desktop.
Save bajorekp/3e49787b4741d7bb566027ffead5dc02 to your computer and use it in GitHub Desktop.
Lists shell themes in your terminal environment

In order to test all oh-my-posh templates:

  1. Set in your .zshrc file:
source ~/test_script.sh
  1. 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) &
  1. 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
  1. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment