From d0f4063f9dffa81206a2b7f78826ceabc385c2b6 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Tue, 16 Mar 2010 23:20:31 -0500 Subject: [PATCH] * etc/byobu/statusrc, usr/bin/byobu-config, usr/lib/byobu/time_utc, usr/share/byobu/profiles/common, usr/share/man/man1/byobu.1: - daylight savings really sucks for those few weeks now when the US is completely different from the rest of the world; having a UTC time byobu status is really useful, LP: #540038 --- debian/changelog | 6 +++++- etc/byobu/statusrc | 1 + usr/bin/byobu-config | 1 + usr/lib/byobu/time_utc | 28 ++++++++++++++++++++++++++++ usr/share/byobu/profiles/common | 3 ++- usr/share/man/man1/byobu.1 | 2 ++ 6 files changed, 39 insertions(+), 2 deletions(-) create mode 100755 usr/lib/byobu/time_utc diff --git a/debian/changelog b/debian/changelog index 6a402d39..5b0229e9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,10 @@ byobu (2.65) unreleased; urgency=low - * UNRELEASED + * etc/byobu/statusrc, usr/bin/byobu-config, usr/lib/byobu/time_utc, + usr/share/byobu/profiles/common, usr/share/man/man1/byobu.1: + - daylight savings really sucks for those few weeks now when the + US is completely different from the rest of the world; having + a UTC time byobu status is really useful, LP: #540038 -- Dustin Kirkland Wed, 10 Mar 2010 19:06:51 -0600 diff --git a/etc/byobu/statusrc b/etc/byobu/statusrc index 10110af5..86c73f28 100644 --- a/etc/byobu/statusrc +++ b/etc/byobu/statusrc @@ -45,6 +45,7 @@ reboot_required=1 release=1 services=1 time=1 +time_utc=0 users=0 updates_available=1 uptime=1 diff --git a/usr/bin/byobu-config b/usr/bin/byobu-config index 2aa0a837..7dc68bed 100755 --- a/usr/bin/byobu-config +++ b/usr/bin/byobu-config @@ -305,6 +305,7 @@ def readstatus(): status["release"]=1 status["services"]=1 status["time"]=1 + status["time_utc"]=0 status["users"]=0 status["updates_available"]=1 status["uptime"]=1 diff --git a/usr/lib/byobu/time_utc b/usr/lib/byobu/time_utc new file mode 100755 index 00000000..585e90d0 --- /dev/null +++ b/usr/lib/byobu/time_utc @@ -0,0 +1,28 @@ +#!/bin/sh -e +# +# time_utc - print UTC time in HH:MM +# Copyright (C) 2010 Canonical Ltd. +# +# Authors: Dustin Kirkland +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +case "$1" in + --detail) + date -u + ;; + *) + printf "%s UTC" $(date -u +%H:%M) + ;; +esac + diff --git a/usr/share/byobu/profiles/common b/usr/share/byobu/profiles/common index 34934ce3..e68d0517 100644 --- a/usr/share/byobu/profiles/common +++ b/usr/share/byobu/profiles/common @@ -69,6 +69,7 @@ backtick 128 23 23 byobu-status fan_speed backtick 129 67 67 byobu-status apport backtick 130 5 5 byobu-status custom backtick 131 53 53 byobu-status services +backtick 132 11 11 byobu-status time_utc hardstatus alwayslastline @@ -98,7 +99,7 @@ source $HOME/.byobu/keybindings caption always "%12`%?%-Lw%50L>%?%{=r}%n*%f %t%?(%u)%?%{-}%12`%?%+Lw%?%11` %=%12`%110`%109`%122`%111`%10`%<" # Status string, last line -hardstatus string '%99`%{-}%{=r}%12` %100`%112`%= %130`%102`%101`%129`%131`%127`%114`%115`%108`%128`%125`%126`%113`%119`%117`%116`%106`%104`%103`%105`%107`%123`%120`%121`' +hardstatus string '%99`%{-}%{=r}%12` %100`%112`%= %130`%102`%101`%129`%131`%127`%114`%115`%108`%128`%125`%126`%113`%119`%117`%116`%106`%104`%103`%105`%107`%123`%132`%120`%121`' # NOTE: Older version of screen have an arbitrary limit of only being able # to change colors 16 times in this 'hardstatus string'. diff --git a/usr/share/man/man1/byobu.1 b/usr/share/man/man1/byobu.1 index 357fcb70..349e3e96 100644 --- a/usr/share/man/man1/byobu.1 +++ b/usr/share/man/man1/byobu.1 @@ -59,6 +59,8 @@ byobu \- wrapper script for seeding a user's byobu configuration and launching s \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_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 + \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, '!!' \fBuptime\fP \- the total system uptime since last boot; displayed in the lower bar toward the right in blue text on a grey background