#!/usr/bin/env bash
### ./gen_prompt.sh
### Output: bash script that configures a randomly colorful prompt (PS1).
### matt.a.feenstra@gmail.com
### For Example:
### eval $(gen_prompt.sh)
echo 'PROMPT_DIRTRIM=4'
PS_STRING="'\[\033[38;5;$(shuf -i 27-231 -n 1)m\]\u\[\033[38;5;$(shuf -i 27-231 -n 1)m\]@\[\033[38;5;$(shuf -i 27-231 -n 1)m\]\h\[\033[38;5;$(shuf -i 27-231 -n 1)m\]:\[\033[38;5;$(shuf -i 27-231 -n 1)m\]\j\[\033[38;5;$(shuf -i 27-231 -n 1)m\]:\[\033[38;5;$(shuf -i 27-231 -n 1)m\]\w\[\033[38;5;$(shuf -i 27-231 -n 1)m\]\\$\[\033[00m\] '"
echo export PS1=$PS_STRING
Matt Feenstra is an Architect and Developer, living and working in Palm Desert, CA
Monday, April 11, 2022
Randomly Colorful Unix Terminal Prompt
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment