From ed440d5a24ada66b92475ea90d6404dad015b70f Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Mon, 10 Feb 2014 14:37:18 -0600 Subject: [PATCH] * usr/bin/byobu-janitor, usr/lib/byobu/date, usr/lib/byobu/include/constants, usr/lib/byobu/include/shutil, usr/lib/byobu/time, usr/share/byobu/profiles/tmux, usr/share/byobu/profiles/tmuxrc, usr/share/man/man1/byobu.1: - LP: #1059127 - fix longstanding "date and time flash on and off" bug - this isn't a great fix, but it's a start - basically, we need to use the tmux status native support for timestamps - support configuration through ~/.byobu/datetime.tmux - this will be a difference between byobu-tmux and byobu-screen, which is a bummer - also, there's more work to be done, in order to enable/disable this via F9/byobu-config --- debian/changelog | 15 ++++++++++++++- usr/bin/byobu-janitor | 1 + usr/lib/byobu/date | 5 ----- usr/lib/byobu/include/constants | 2 ++ usr/lib/byobu/include/shutil | 4 ++-- usr/lib/byobu/time | 5 ----- usr/share/byobu/profiles/tmux | 2 +- usr/share/byobu/profiles/tmuxrc | 1 + usr/share/man/man1/byobu.1 | 6 +++--- 9 files changed, 24 insertions(+), 17 deletions(-) diff --git a/debian/changelog b/debian/changelog index 30a4480f..b5b4569f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,19 @@ byobu (5.71) unreleased; urgency=low - * UNRELEASED + * usr/bin/byobu-janitor, usr/lib/byobu/date, + usr/lib/byobu/include/constants, usr/lib/byobu/include/shutil, + usr/lib/byobu/time, usr/share/byobu/profiles/tmux, + usr/share/byobu/profiles/tmuxrc, usr/share/man/man1/byobu.1: + - LP: #1059127 + - fix longstanding "date and time flash on and off" bug + - this isn't a great fix, but it's a start + - basically, we need to use the tmux status native support + for timestamps + - support configuration through ~/.byobu/datetime.tmux + - this will be a difference between byobu-tmux and byobu-screen, + which is a bummer + - also, there's more work to be done, in order to enable/disable + this via F9/byobu-config -- Dustin Kirkland Thu, 16 Jan 2014 17:48:35 -0600 diff --git a/usr/bin/byobu-janitor b/usr/bin/byobu-janitor index 4228bef1..c7f244a3 100755 --- a/usr/bin/byobu-janitor +++ b/usr/bin/byobu-janitor @@ -68,6 +68,7 @@ MC=0 # Setup initial local user configuration [ -r "$BYOBU_CONFIG_DIR/color" ] || printf "BACKGROUND=k\nFOREGROUND=w\nMONOCHROME=$MC" > "$BYOBU_CONFIG_DIR/color" [ -r "$BYOBU_CONFIG_DIR/color.tmux" ] || printf "BYOBU_DARK=black\nBYOBU_LIGHT=white\nBYOBU_ACCENT=magenta\nBYOBU_HIGHLIGHT=red\nMONOCHROME=$MC" > "$BYOBU_CONFIG_DIR/color.tmux" +[ -r "$BYOBU_CONFIG_DIR/datetime.tmux" ] || printf 'BYOBU_DATE="%%Y-%%m-%%d "\nBYOBU_TIME="%%H:%%M:%%S"\n' > "$BYOBU_CONFIG_DIR/datetime.tmux" [ -r "$BYOBU_CONFIG_DIR/profile" ] || echo "source \$BYOBU_PREFIX/share/$PKG/profiles/common" > "$BYOBU_CONFIG_DIR/profile" [ -r "$BYOBU_CONFIG_DIR/profile.tmux" ] || echo "source \$BYOBU_PREFIX/share/$PKG/profiles/tmux" > "$BYOBU_CONFIG_DIR/profile.tmux" [ -r "$BYOBU_CONFIG_DIR/keybindings" ] || echo "source \$BYOBU_PREFIX/share/$PKG/keybindings/common" > "$BYOBU_CONFIG_DIR/keybindings" diff --git a/usr/lib/byobu/date b/usr/lib/byobu/date index 465e46fe..193a23ab 100755 --- a/usr/lib/byobu/date +++ b/usr/lib/byobu/date @@ -26,13 +26,8 @@ __date_detail() { __date() { case "$BYOBU_BACKEND" in screen) - bd=$(date "+%m%d") - [ "$bd" = "0320" ] && msg="$(printf "%s" SGFwcHkgQmlydGhkYXkgU2NyZWVuIC0tIGh0dHA6Ly9iaXQubHkvc2NyZWVuLWJkYXkK | base64 -di)" && $BYOBU_BACKEND -X -S "byobu" at "*" echo "[$msg]" color none; printf "\005Y-\005m-\005d"; color -- ;; - tmux|*) - date +"%Y-%m-%d " - ;; esac } diff --git a/usr/lib/byobu/include/constants b/usr/lib/byobu/include/constants index 34b45f0d..58cc782e 100755 --- a/usr/lib/byobu/include/constants +++ b/usr/lib/byobu/include/constants @@ -70,3 +70,5 @@ export BYOBU_LIGHT="white" export BYOBU_ACCENT="#75507B" # AUBERGINE export BYOBU_HIGHLIGHT="#DD4814" # UBUNTU ORANGE export BYOBU_WINDOW_NAME="-" +export BYOBU_DATE="%Y-%m-%d " +export BYOBU_TIME="%H:%M:%S" diff --git a/usr/lib/byobu/include/shutil b/usr/lib/byobu/include/shutil index 90ea77b8..9633335b 100755 --- a/usr/lib/byobu/include/shutil +++ b/usr/lib/byobu/include/shutil @@ -243,7 +243,7 @@ status_freq() { cpu_freq) _RET=2 ;; cpu_temp) _RET=19 ;; custom) _RET=5 ;; - date) [ "$BYOBU_BACKEND" = "tmux" ] && _RET=1 || _RET=28793 ;; + date) _RET=9999999 ;; disk) _RET=13 ;; disk_io) _RET=3 ;; distro) _RET=9999999 ;; @@ -267,7 +267,7 @@ status_freq() { services) _RET=53 ;; session) _RET=9999999 ;; swap) _RET=19 ;; - time) [ "$BYOBU_BACKEND" = "tmux" ] && _RET=1 || _RET=9999999 ;; + time) _RET=9999999 ;; time_binary) _RET=23 ;; time_utc) _RET=11 ;; trash) _RET=9999999 ;; diff --git a/usr/lib/byobu/time b/usr/lib/byobu/time index d527c5f5..915c6f5e 100755 --- a/usr/lib/byobu/time +++ b/usr/lib/byobu/time @@ -32,11 +32,6 @@ __time() { [ "$secs" != "0" ] && format="$format:\005s" printf $format ;; - tmux|*) - format="%H:%M" - [ "$secs" != "0" ] && format="$format:%S" - date +$format - ;; esac } diff --git a/usr/share/byobu/profiles/tmux b/usr/share/byobu/profiles/tmux index db1ce249..1922e3c9 100644 --- a/usr/share/byobu/profiles/tmux +++ b/usr/share/byobu/profiles/tmux @@ -85,7 +85,7 @@ set -g status-interval 1 set -g status-left-length 256 set -g status-right-length 256 set -g status-left '#(byobu-status tmux_left)' -set -g status-right '#(byobu-status tmux_right)' +set -g status-right '#(byobu-status tmux_right)'$BYOBU_DATE$BYOBU_TIME set -g message-bg $BYOBU_ACCENT set -g message-fg white diff --git a/usr/share/byobu/profiles/tmuxrc b/usr/share/byobu/profiles/tmuxrc index c655c6f5..843a295d 100644 --- a/usr/share/byobu/profiles/tmuxrc +++ b/usr/share/byobu/profiles/tmuxrc @@ -23,6 +23,7 @@ ############################################################################### source-file $HOME/.byobu/color.tmux +source-file $HOME/.byobu/datetime.tmux source-file $BYOBU_CONFIG_DIR/profile.tmux source-file $BYOBU_CONFIG_DIR/keybindings.tmux source-file $BYOBU_CONFIG_DIR/.tmux.conf diff --git a/usr/share/man/man1/byobu.1 b/usr/share/man/man1/byobu.1 index a81963de..515c989b 100644 --- a/usr/share/man/man1/byobu.1 +++ b/usr/share/man/man1/byobu.1 @@ -43,7 +43,7 @@ The background colors of the \fBbyobu\fP status lines can be adjusted by editing printf "\\005{= bw}%s\\005{\-}" "$(uname \-r)" -\fBdate\fP \- the system date in YYYY-MM-DD formate; displayed in the lower on the far right in the default text color on the default background +\fBdate\fP \- the system date in YYYY-MM-DD format, or you can set this to any valid \fBstrftime\fP(3) you like in \fI$BYOBU_CONFIG_DIR/datetime\fP; displayed in the lower on the far right in the default text color on the default background \fBdisk\fP \- total disk space available and total used on / directory; displayed in the lower bar on the far right in white text on a light purple background; override the default directory by specifying an alternate mount point with MONITORED_DISK=/wherever in \fI$BYOBU_CONFIG_DIR/statusrc\fP @@ -95,11 +95,11 @@ The background colors of the \fBbyobu\fP status lines can be adjusted by editing \fBswap\fP \- total swap space and total used as a percentage of the total available; displayed in the lower bar toward the right in white text on a light green background with a trailing '%' sign -\fBtime\fP \- the system time in HH:MM:SS format; displayed in the lower bar on the far right in the default text and default background colors +\fBtime\fP \- the system time in HH:MM:SS format (by default), or you can set this to any valid \fBstrftime\fP(3) you like in \fI$BYOBU_CONFIG_DIR/datetime\fP; displayed in the lower bar on the far right in the default text and default background colors \fBtime_binary\fP \- only for the hard core geek, the local system time in binary; requires UTF-8 support in a VERY recent version of GNU Screen; displayed in the lower bar on the far right in the default text and background colors -\fBtime_utc\fP \- the UTC system time in HH:MMformat; displayed in the lower bar on the far right in dark text on a light background +\fBtime_utc\fP \- the UTC system time in HH:MM format; displayed in the lower bar on the far right in dark text on a light background \fBupdates_available\fP \- the number of updates available on the system; displayed in the lower bar toward the right in white text on a red background with a trailing '!' sign; if any updates are marked 'security updates', then there will be a total of two trailing exclamation points, '!!'