Skip to content

Instantly share code, notes, and snippets.

@84adam
Last active March 29, 2017 16:42
Show Gist options
  • Save 84adam/f3ac53ea1ce783440b946fa48e22c87d to your computer and use it in GitHub Desktop.
Save 84adam/f3ac53ea1ce783440b946fa48e22c87d to your computer and use it in GitHub Desktop.
Green $PS1 with $USD bitcoin price from wink.sh
from your home folder, type "vim .bashrc"
type "i" to edit; add the following section to your bashrc file under "# User specific aliases and functions":
you can use `SHIFT+INSERT` to paste text into the terminal
---
# (optional)
# Limit directory path shown in prompt to only display current and one parent directory
# Example: user@hostname ../firstparent/currentdir/ $
export PROMPT_DIRTRIM=2
# Create and export DOLAMT USD value variable
# Make sure you have run wink.sh at least once already
export DOLAMT="$(cat $HOME/bin/wink/dolamt.log)"
# Original $PS1
# export PS1='[\u@\h \W]\ '
# New PS1 - Green Color with USD btc value:
export PS1='\[\e[1;32m\]\u@\h \$$DOLAMT: \w${text}$\[\e[m\] '
# run "$ source ~/.bashrc" to load changes w/o logging out
# example output: user@hostname $1000: ~$
# gist URL: https://gist.github.com/84adam/f3ac53ea1ce783440b946fa48e22c87d
---
save and quit: ":wq"
run "source ~/.bashrc" to load the new changes
# If you notice the Price ($USDBTC) not updating, run wink.sh again first...
# Or set a cron/anacron job to auto-update this.
@84adam
Copy link
Author

84adam commented Feb 22, 2017

Red version for 'root' user:


# (optional)
# Limit directory path shown in prompt to only display current and one parent directory
# Example:  user@hostname ../firstparent/currentdir/ $

export PROMPT_DIRTRIM=2

# Create and export DOLAMT USD value variable
# Make sure you have run wink.sh at least once already

export DOLAMT="$(cat $HOME/bin/wink/dolamt.log)"

# light red text with $USD btc value for root with #

export PS1='\[\e[1;31m\]\u@\h \\$$DOLAMT: \w \$\[\e[m\] '

# run "$ source ~/.bashrc" to load changes w/o logging out
# example for root: root@hostname $1000: ~ #
# gist URL: https://gist.github.com/84adam/f3ac53ea1ce783440b946fa48e22c87d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment