Skip to content

Commit

Permalink
Merge pull request #179 from mithro/prompt
Browse files Browse the repository at this point in the history
scripts: More fancy prompt.
  • Loading branch information
mithro committed Jan 24, 2016
2 parents b7cb1cd + de7d3f6 commit 496105f
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion scripts/setup-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,25 @@ alias python=python3
export HDMI2USB_ENV=1

# Set prompt
PS1="(HDMI2USB)$PS1"
ORIG_PS1="$PS1"
hdmi2usb_prompt() {
P=""
if [ ! -z "$BOARD" ]; then
P="$P B=$BOARD"
fi
if [ ! -z "$TARGET" ]; then
P="$P T=$TARGET"
fi
if [ ! -z "$PROG" ]; then
P="$P P=$PROG"
fi

if [ ! -z "$P" ]; then
P="(H2U$P) $ORIG_PS1"
else
P="(HDMI2USB) $ORIG_PS1"
fi

PS1=$P
}
PROMPT_COMMAND=hdmi2usb_prompt

0 comments on commit 496105f

Please sign in to comment.