Created
April 9, 2020 09:26
-
-
Save microft/50466a39894e83a95210ccef57c9b310 to your computer and use it in GitHub Desktop.
smileyface in zsh PS1
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
function smileyface | |
{ | |
case $? in | |
0 ) | |
echo -ne "$fg[green] :)" | |
;; | |
1 ) | |
echo -ne "$fg[red] ;(" | |
;;* ) | |
echo -ne "$fg[yellow] %%(" | |
;; | |
esac | |
return 0 | |
} | |
setopt PROMPT_SUBST | |
export PS1="%{$fg[red]%}%m%{$fg[white]%}%~%{$reset_color%}% \$(smileyface) %{$reset_color%}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment