Skip to content

Instantly share code, notes, and snippets.

@mtrudel
Created November 23, 2010 16:40
Show Gist options
  • Select an option

  • Save mtrudel/712063 to your computer and use it in GitHub Desktop.

Select an option

Save mtrudel/712063 to your computer and use it in GitHub Desktop.
whereami()
{
export THIS_IS_NOT_MY_BEAUTIFUL_HOUSE=$1
}
__thereami()
{
local curtask="$THIS_IS_NOT_MY_BEAUTIFUL_HOUSE"
if [ -n "$curtask" ]; then
if [ -n ${1-} ]; then
printf "${1-}" $curtask
fi
fi
}
#
# Add the following block to your PS1 as desired. The argument to __thereami
# will be echoed back if a todo is set, with the todo filled in as %s
#
# As an example, the following will add !!<todo text>!! in red into your
# prompt, assuming that you have colour codes set up as per lines 16-31 of
# https://github.com/mtrudel/dotfiles/blob/master/bashrc
#
# \$(__thereami '\[${RED}\]!!%s!!\[${NOCOLOR}\]')
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment