From 4b93622dcc9c696908ed2269c4ab711589649711 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Sun, 27 Jul 2014 03:16:26 +0100 Subject: [PATCH] * usr/bin/byobu-status.in: - restore the ability to toggle date and time on and off from the config interface, as well as hand editing the config file --- debian/changelog | 3 +++ usr/bin/byobu-status.in | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/debian/changelog b/debian/changelog index 176286c3..08a1cbb9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,9 @@ byobu (5.84) unreleased; urgency=medium - make the custom scripts bin dir * usr/lib/byobu/custom: - ensure we clear the cache for custom scripts + * usr/bin/byobu-status.in: + - restore the ability to toggle date and time on and off from the config + interface, as well as hand editing the config file -- Dustin Kirkland Sat, 26 Jul 2014 16:13:23 -0500 diff --git a/usr/bin/byobu-status.in b/usr/bin/byobu-status.in index 04e1459d..762d1d87 100755 --- a/usr/bin/byobu-status.in +++ b/usr/bin/byobu-status.in @@ -35,6 +35,7 @@ PKG="byobu" for i in "${BYOBU_PREFIX}/share/$PKG/status/status" "${BYOBU_PREFIX}/share/$PKG/status/statusrc" "$BYOBU_CONFIG_DIR/status" "$BYOBU_CONFIG_DIR/statusrc" "$BYOBU_CONFIG_DIR/color" "$BYOBU_CONFIG_DIR/color.tmux"; do [ -r "$i" ] && . "$i" done +[ -r "$BYOBU_CONFIG_DIR/datetime.tmux" ] && . "$BYOBU_CONFIG_DIR/datetime.tmux" case "$BYOBU_BACKEND" in screen) @@ -110,6 +111,42 @@ case "$1" in *left|*right) eval items="\$$1" for i in $items; do + if [ "$BYOBU_BACKEND" = "tmux" ]; then + case "$i" in + \#date) + if [ -n "$BYOBU_DATE" ]; then + $BYOBU_SED -i -e "/BYOBU_DATE=/d" "$BYOBU_CONFIG_DIR/datetime.tmux" + printf "%s\n" 'BYOBU_DATE=' >> "$BYOBU_CONFIG_DIR/datetime.tmux" + touch "$BYOBU_RUN_DIR/reload-required" + continue + fi + ;; + \#time) + if [ -n "$BYOBU_TIME" ]; then + $BYOBU_SED -i -e "/BYOBU_TIME=/d" "$BYOBU_CONFIG_DIR/datetime.tmux" + printf "%s\n" 'BYOBU_TIME=' >> "$BYOBU_CONFIG_DIR/datetime.tmux" + touch "$BYOBU_RUN_DIR/reload-required" + continue + fi + ;; + date) + if [ -z "$BYOBU_DATE" ]; then + $BYOBU_SED -i -e "/BYOBU_DATE=/d" "$BYOBU_CONFIG_DIR/datetime.tmux" + printf "%s\n" 'BYOBU_DATE="%Y-%m-%d "' >> "$BYOBU_CONFIG_DIR/datetime.tmux" + touch "$BYOBU_RUN_DIR/reload-required" + continue + fi + ;; + time) + if [ -z "$BYOBU_TIME" ]; then + $BYOBU_SED -i -e "/BYOBU_TIME=/d" "$BYOBU_CONFIG_DIR/datetime.tmux" + printf "%s\n" 'BYOBU_TIME="%H:%M:%S"' >> "$BYOBU_CONFIG_DIR/datetime.tmux" + touch "$BYOBU_RUN_DIR/reload-required" + continue + fi + ;; + esac + fi case "$i" in \#*) continue ;; esac get_status "$i" done