Last active
August 20, 2018 22:59
-
-
Save eramdam/1f8be93dbd3dc6c61c1d25289b176201 to your computer and use it in GitHub Desktop.
Get A Nice iTerm2/zsh Config With These Easy Tricks! (random emoji goodness)
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
# Load the `emoji` plugin | |
plugins=(... emoji) | |
# ... | |
# source oh-my-zsh and whatnots | |
# .... | |
# Set a session emoji | |
session_emoji=`random_emoji fruits` | |
# Change the window/tab title with current path + session's emoji | |
precmd () { | |
tab_label=${PWD/${HOME}/\~} # use 'relative' path | |
# Here I chose to have the emoji on tab/panes titles but you can add it to the window's title as well! | |
echo -ne "\e]2;${tab_label}\a" # set window title to full string | |
# set tab title to rightmost 24 characters + the emoji for quick way to spot | |
echo -ne "\e]1;${session_emoji} ${tab_label: -24}\a" | |
} | |
# Clear the title | |
title() {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment