summary refs log tree commit diff
path: root/bin/hibiki/prompt
blob: d23fc28452174a09fb716f758f2c000037abc827 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

# make sure window title is set in terminals
SET_TERM_TITLE='\[\033]0;\u@\h:\w\007\]'

if [ "$1" == "err" ]; then
	color="\[$(tput setaf 1)\]" # red
else
	color="\[$(tput setaf 10)\]"
fi
RESET="\[$(tput sgr0)\]"

# count jobs
# shellcheck disable=SC2016
JOBS='`[ \j -gt 0 ] && printf " ∆\j"`'

# show git-bug tickets
# shellcheck disable=SC2016
# BUGS='`exit=$?; git rev-parse >/dev/null 2>&1 && { bugn=$(git bug ls --status=open | wc -l); [ $bugn -gt 0 ] && printf " ⚑${bugn}"; }; exit $exit`'
BUGS=''

# ❱⫶
echo "⋮ ${SET_TERM_TITLE}${color}\w${RESET}${JOBS}${BUGS} ❯ "