add an option to time to hide seconds

This commit is contained in:
Lukas Stabe 2013-02-16 01:41:44 +01:00
commit 097a768ee3
2 changed files with 12 additions and 2 deletions

View file

@ -24,12 +24,18 @@ __time_detail() {
}
__time() {
local secs=1
[ -n "$TIME_SECONDS" ] && secs=$TIME_SECONDS
case "$BYOBU_BACKEND" in
screen)
printf "\0050c:\005s"
format="\0050c"
[ "$secs" != "0" ] && format="$format:\005s"
printf $format
;;
tmux|*)
date +"%H:%M:%S"
format="%H:%M"
[ "$secs" != "0" ] && format="$format:%S"
date +$format
;;
esac
}

View file

@ -72,3 +72,7 @@
# to instead count number of distinct users logged onto the system
# Default: 0
#USERS_DISTINCT=0
# Set this to zero to hide seconds int the time display
# Default 1
#TIME_SECONDS=0