alextea / bash-emoji

Add emoji to your bash prompt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bash-emoji

🍏 🍎 🍐 🍊 πŸ‹ 🍌 πŸ‰ πŸ‡

Some simple tools to add random emoji to your bash prompt

πŸ‘¨πŸ» πŸ§”πŸ» πŸ•΅πŸ»β€ πŸ‘¨πŸ»β€πŸŽ€ πŸ‘¨πŸ»β€πŸ’» πŸ‘¨πŸ»β€πŸ”§ πŸ‘¨πŸ»β€βš–οΈ 🀡🏻

clock-emoji.sh

Use this script to add a clock emoji πŸ• to nearest half hour to your prompt.

Include the script in your bash_profile like so:

source ~/path_to_script/clock_emoji.sh

And add the clock_emoji function in your PS1 variable.

PS1='$(clock_emoji) \u@\h \W\\$'

This will output something like:

πŸ• alex_tea@mymac ~/path_to_script$

emoji-prompt.sh

This script returns an emoji randomly selected from one of 2 arrays, face_emoji or folder_emoji. face_emoji contains different faces and folder_emoji has different emoji that look cool in front of a folder name.

You can edit the arrays if you wish, and you should probably update the face_emoji array to suit your needs.

The script also amends these arrays based on the date at certain times of the year for special occasions, like Halloween or Christmas.

You need to include the script in your bash_profile:

source ~/path_to_script/emoji-prompt.sh

And then call the function in your PS1 variable.

PS1='$(random_emoji face) \u $(random_emoji folder) \W\\$'

That will output something like:

πŸ‘¨πŸ»β€πŸ’» alex_tea πŸ₯‘ ~/path_to_script$

You can combine both scripts for maximum emoji power.

PS1='$(clock_emoji): $(random_emoji face) \u $(random_emoji folder) \W\\$'
πŸ•: πŸ‘¨πŸ»β€πŸ’» alex_tea πŸ₯‘ ~/path_to_script$

About

Add emoji to your bash prompt

License:MIT License


Languages

Language:Shell 100.0%