From a65fcf561a5c71fa29efb16ce69bf8c25cb80c1a Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Wed, 17 Jun 2009 14:56:13 -0500 Subject: [PATCH] * bin/mail, byobu-status, byobu.1, profiles/common, profiles/profile.skel, rpm/byobu.spec: add a mail status notification, LP: #387936 Signed-off-by: Dustin Kirkland --- bin/mail | 26 ++++++++++++++++++++++++++ byobu-status | 2 +- byobu.1 | 2 ++ debian/changelog | 6 +++++- profiles/common | 1 + profiles/profile.skel | 2 +- rpm/byobu.spec | 1 + 7 files changed, 37 insertions(+), 3 deletions(-) create mode 100755 bin/mail diff --git a/bin/mail b/bin/mail new file mode 100755 index 00000000..e1976248 --- /dev/null +++ b/bin/mail @@ -0,0 +1,26 @@ +#!/bin/sh -e +# +# mail: notify the user if they have system mail +# Copyright (C) 2009 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 . + +mailfile="/var/spool/mail/$USER" +if [ "$1" = "--detail" ]; then + ls -alF "$mailfile" 2>&1 + exit 0 +fi + +[ -s "$mailfile" ] && printf "\005{=b Wb}M\005{-} " || exit 0 diff --git a/byobu-status b/byobu-status index a92871a4..1b16f87f 100755 --- a/byobu-status +++ b/byobu-status @@ -74,7 +74,7 @@ case "$P" in [ "$x" = "0" ] && exit 0 ;; # default = off, user must override to turn on - arch|battery|disk_available|disk_used|ec2_cost|hostname|ip_address|network|processes|users|temp_c|temp_f|whoami|wifi_quality) + arch|battery|disk_available|disk_used|ec2_cost|hostname|ip_address|mail|network|processes|users|temp_c|temp_f|whoami|wifi_quality) [ "$x" = "1" ] || exit 0 ;; --detail) diff --git a/byobu.1 b/byobu.1 index f52357f2..9c0da50d 100644 --- a/byobu.1 +++ b/byobu.1 @@ -21,6 +21,8 @@ byobu \- wrapper script for seeding a user's byobu configuration and launching s \fBdisk_available\fP \- disk space available 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 in \fI$HOME/.byobu/disk\fP +\fBmail\fP \- system mail for the current user; the letter 'M' is displayed in the lower bar toward the left in blue text on a white background + \fBmem_used\fP \- disk space used on / directory as a percentage of the total space available on /; displayed in the lower bar on the far right in white text on a light purple background with a trailing '%' sign; override the default directory by specifying an alternate mount point in \fI$HOME/.byobu/disk\fP \fBec2_cost\fP \- an estimation of the cost of the current boot of the system in terms of the Amazon EC2 billing model; displayed in the lower bar toward the right in green text on a grey background; there is a leading '~' to indicate that this is an estimation, and the monetary units are US Dollars '$' diff --git a/debian/changelog b/debian/changelog index b8b7747e..8f2a7874 100644 --- a/debian/changelog +++ b/debian/changelog @@ -46,7 +46,11 @@ byobu (2.12) unreleased; urgency=low also support a new keyset, screen-escape-keys which profiles ctrl-a keybindings for common byobu functions, LP: #380944 - -- Dustin Kirkland Wed, 17 Jun 2009 14:17:15 -0500 + * bin/mail, byobu-status, byobu.1, profiles/common, + profiles/profile.skel, rpm/byobu.spec: add a mail status notification, + LP: #387936 + + -- Dustin Kirkland Wed, 17 Jun 2009 14:55:33 -0500 byobu (2.11-0ubuntu1) karmic; urgency=low diff --git a/profiles/common b/profiles/common index ef5e972e..277cb179 100644 --- a/profiles/common +++ b/profiles/common @@ -54,6 +54,7 @@ backtick 123 86400 86400 byobu-status disk_available backtick 124 30 30 byobu-status disk_used backtick 125 30 30 byobu-status temp_c backtick 126 30 30 byobu-status temp_f +backtick 127 10 10 byobu-status mail hardstatus alwayslastline diff --git a/profiles/profile.skel b/profiles/profile.skel index abb49ebb..d86acc99 100644 --- a/profiles/profile.skel +++ b/profiles/profile.skel @@ -26,7 +26,7 @@ source /usr/share/byobu/profiles/common caption always "%{kW}%?%-Lw%?%{bw}%n*%f %t%?(%u)%?%{kW}%?%+Lw%? %= %{= Wk}%110`%109`%122`%111`" # Status string, last line -hardstatus string '%99`%{= Wk} %100`%112`%= %102`%101`%114`%115`%108`%125`%126`%113`%119`%117`%116`%106`%104`%103`%105`%107`%123`%124`%120`%121`' +hardstatus string '%99`%{= Wk} %100`%112`%= %102`%101`%127`%114`%115`%108`%125`%126`%113`%119`%117`%116`%106`%104`%103`%105`%107`%123`%124`%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/rpm/byobu.spec b/rpm/byobu.spec index a76ae2fd..c05a4de3 100644 --- a/rpm/byobu.spec +++ b/rpm/byobu.spec @@ -108,6 +108,7 @@ rm -rf $RPM_BUILD_ROOT /usr/lib/byobu/ip_address /usr/lib/byobu/load_average /usr/lib/byobu/logo +/usr/lib/byobu/mail /usr/lib/byobu/mem_available /usr/lib/byobu/mem_used /usr/lib/byobu/menu