I want my shell prompt to look like a cheeseburger! 🍔🍔🍔
It would be nice if it also displayed: username, hostname, and current directory.
great choice!
$ sudo apt-get install ttf-ancient-fonts
$ export PS1="\\u@\h \\w 🍔 "
enjoy.
Putting a cheeseburger on the prompt:
Install a unicode font that contains this character:
sudo apt-get install ttf-ancient-fonts
Try the prompt:
export PS1="\\u@\h \\w 🍔 "
Make permanent the change (if you don't do that, it will reset once terminal is closed):
nano .bashrc
Locate these lines:
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
Replace \$
character a the end of the lines beginning with PS1=
by the cheeseburger:
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] 🍔 '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\ 🍔 '
fi
Typing a cheeseburger everywhere (linux only):
u
will appear.I couldn't help but take this probably a step too far. This version updates your prompt to display a different character based on time of day, to illustrate what you should be doing at that time.
declare -A pp
pp=(["09"]="🍩🍵" ["07"]="🌅" ["08"]="🌅" [10]="💻" [11]="💻" [12]="🍔🍟" [13]="🍔🍟" [14]="💻" [15]="💻" [16]="💻" [17]="🚗" [18]="🚗" [19]="🍷🍸" [20]="🍷🍸" [24]="🌙")
u_pp() {
c=${pp[`date +"%H"`]}
if [[ $c == "" ]]; then
c=${pp[24]}
fi
PS1='\u@\h:\w${c} '
};
u_pp
export PROMPT_COMMAND="u_pp;"
Probably there's a more concise way to do it; my bash isn't all that great.
To add the current time of day on the left side, replace the assignment of PS1
:
PS1='[\@] \u@\h:\w${c} '
askubuntu
, but I'm just wondering do you have an idea on get this working with mac
, coz I'm getting no matches found: [9]= 🍩🍵
when I add this in to my (mac) ~/.bash_profile :)
May 25, 2015 at 23:16
If you can't install the 'ancient fonts' maybe a sideways ASCII art cheeseburger would work?
export PS1="\\u@\h \\w (||]"
Of course, there could be different ways of typing this, possibly including lettuce, pickles, etc.
You can use the following code to create a useful and colorful prompt with an ASCII art hamburger. Well... to be correct, this is a cheeseburger, red meat, with salad on white Italian bread! Special delight! ;-)
Login as the user, go to the home folder and open the bashrc file:
vim ~/.bashrc
Add or replace the following line:
export PS1="\[\e[01;37m\][\[\e[0m\]\[\e[01;32m\]\u\[\e[0m\]\[\e[00;37m\]@\[\e[0m\]\[\e[01;34m\]\h\[\e[0m\]\[\e[00;37m\] \[\e[0m\]\[\e[00;37m\]\t\[\e[0m\]\[\e[01;37m\] \W \e[1;37m(\e[1;32m|\e[1;33m|\e[1;31m|\e[1;37m]\\$ \[\e[0m\]"
Result (no colors):
[john@server003 15:39:14 ~ (|||]$
Green Cheeseburger:
export PS1='\[\e[1;32m\][\u@\h \W]\🍔 \[\e[0m\] '
Red Cheesburger:
export PS1='\[\e[1;31m\][\u@\h \W]\🍔 \[\e[0m\] '
Bicycle:
export PS1="\\u@\h \\w 🚴 "
or
export PS1="\\u@\h \\w 🚵 "
Love hearts:
export PS1="\\u@\h \\w 💞 💖 💓 💕 💘 "
Show the time on the left and a watch on the right:
export PS1="[\@] \u@\h 🕒 "
Aside from pasting the emoji into the prompt definition directly, you can use the Unicode code point for cheeseburger with printf
and command substitution within the prompt:
$ PS1='$(printf "\U0001f354") $ '
🍔 $ echo "Hello,my cheesy prompt!"
Hello,my cheesy prompt!
🍔 $
ttf-ancient-fonts
package.