$PS1 with BTC price from wink.sh
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
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. |