Closed emunozhern closed 4 years ago
My config in ~/.oh-my-zsh/themes/agnoster.zsh-theme to random emoji.
~/.oh-my-zsh/themes/agnoster.zsh-theme
prompt_context() { # Custom (Random emoji) emojis=("⚡️" "🔥" "💀" "👑" "😎" "🐸" "🐵" "🦄" "🌈" "🍻" "🚀" "💡" "🎉" "🔑" "🇹🇭" "🚦" "🌙") RAND_EMOJI_N=$(( $RANDOM % ${#emojis[@]} + 1)) prompt_segment black default "${emojis[$RAND_EMOJI_N]} " }
Originally posted by @biigpongsatorn in https://github.com/agnoster/agnoster-zsh-theme/issues/39#issuecomment-470603968
You can use "local n" instead of $RAND_EMOJI_N if you want to avoid clobbering variables set by the user or other code.
local n
$RAND_EMOJI_N
FYI, I added this to my AgnosterJ fork: https://github.com/apjanke/agnosterj-zsh-theme/commit/adb1be2a8c289317392b5dc004a0fdd527fefc16.
My config in
~/.oh-my-zsh/themes/agnoster.zsh-theme
to random emoji.Originally posted by @biigpongsatorn in https://github.com/agnoster/agnoster-zsh-theme/issues/39#issuecomment-470603968