From 097a768ee3fee298676de0d99d15dc002acd4b7d Mon Sep 17 00:00:00 2001 From: Lukas Stabe Date: Sat, 16 Feb 2013 01:41:44 +0100 Subject: [PATCH] add an option to time to hide seconds --- usr/lib/byobu/time | 10 ++++++++-- usr/share/byobu/status/statusrc | 4 ++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/usr/lib/byobu/time b/usr/lib/byobu/time index e35c98de..d527c5f5 100755 --- a/usr/lib/byobu/time +++ b/usr/lib/byobu/time @@ -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 } diff --git a/usr/share/byobu/status/statusrc b/usr/share/byobu/status/statusrc index d9d20dcc..048598a8 100644 --- a/usr/share/byobu/status/statusrc +++ b/usr/share/byobu/status/statusrc @@ -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