mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 06:23:19 -07:00
* bin/disk-available, bin/disk-used, byobu-config, byobu-config.1,
byobu-status, profiles/common, profiles/profile.skel: add a new pair of status notifications for disk space available and used; default to / directory, allow user override in config dir Signed-off-by: Dustin Kirkland <kirkland@canonical.com>
This commit is contained in:
parent
6f11953518
commit
a47cf85f24
8 changed files with 90 additions and 3 deletions
39
bin/disk-available
Executable file
39
bin/disk-available
Executable file
|
@ -0,0 +1,39 @@
|
||||||
|
#!/bin/sh -e
|
||||||
|
#
|
||||||
|
# disk-available: print the current disk space available
|
||||||
|
# Copyright (C) 2008 Canonical Ltd.
|
||||||
|
#
|
||||||
|
# Authors: Dustin Kirkland <kirkland@canonical.com>
|
||||||
|
#
|
||||||
|
# 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
PKG="byobu"
|
||||||
|
|
||||||
|
if [ "$1" = "--detail" ]; then
|
||||||
|
df -h
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
comma=
|
||||||
|
whitespace=
|
||||||
|
if [ -r "$HOME/.$PKG/status" ]; then
|
||||||
|
grep -qs "^disk-used=1$" "$HOME/.$PKG/status" && comma="," || whitespace=" "
|
||||||
|
else
|
||||||
|
comma=","
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Default to /, but let users override
|
||||||
|
[ -r "$HOME/.$PKG/disk" ] && MP=`cat "$HOME/.$PKG/disk"` || MP="/"
|
||||||
|
|
||||||
|
d=`df -h "$MP" | tail -n 1 | awk '{print $2}'`
|
||||||
|
printf "\005{= MW}%sB%s\005{-}%s" "$d" "$comma" "$whitespace"
|
36
bin/disk-used
Executable file
36
bin/disk-used
Executable file
|
@ -0,0 +1,36 @@
|
||||||
|
#!/bin/sh -e
|
||||||
|
#
|
||||||
|
# disk-used: print the current disk usage
|
||||||
|
# Copyright (C) 2008 Canonical Ltd.
|
||||||
|
#
|
||||||
|
# Authors: Dustin Kirkland <kirkland@canonical.com>
|
||||||
|
#
|
||||||
|
# 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
PKG="byobu"
|
||||||
|
|
||||||
|
if [ "$1" = "--detail" ]; then
|
||||||
|
df -h
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
whitespace=
|
||||||
|
if [ -r "$HOME/.$PKG/status" ]; then
|
||||||
|
grep -qs "^date=1$" "$HOME/.$PKG/status" && whitespace=" "
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Default to /, but let users override
|
||||||
|
[ -r "$HOME/.$PKG/disk" ] && MP=`cat "$HOME/.$PKG/disk"` || MP="/"
|
||||||
|
|
||||||
|
df -h "$MP" | tail -n 1 | awk '{print "\005{= MW}" $5 "\005{-}"}'
|
||||||
|
printf "%s" "$whitespace"
|
|
@ -249,6 +249,8 @@ def readstatus():
|
||||||
status["cpu-count"]=1
|
status["cpu-count"]=1
|
||||||
status["cpu-freq"]=1
|
status["cpu-freq"]=1
|
||||||
status["date"]=1
|
status["date"]=1
|
||||||
|
status["disk-available"]=0
|
||||||
|
status["disk-used"]=0
|
||||||
status["ec2-cost"]=0
|
status["ec2-cost"]=0
|
||||||
status["hostname"]=0
|
status["hostname"]=0
|
||||||
status["ip-address"]=0
|
status["ip-address"]=0
|
||||||
|
|
|
@ -21,6 +21,10 @@ The menu provided by the \fBbyobu\fP should be self-explanatory.
|
||||||
|
|
||||||
\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 formate; displayed in the lower on the far right in the default text color on the default background
|
||||||
|
|
||||||
|
\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
|
||||||
|
|
||||||
|
\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 '$'
|
\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 '$'
|
||||||
|
|
||||||
\fBhostname\fP \- the hostname of the system; displayed in the upper bar on the far right in bold black text on a grey background; there is a leading '@' symbol if the username status is also enabled
|
\fBhostname\fP \- the hostname of the system; displayed in the upper bar on the far right in bold black text on a grey background; there is a leading '@' symbol if the username status is also enabled
|
||||||
|
|
|
@ -63,7 +63,7 @@ case "$P" in
|
||||||
grep -qs -m1 "^$P=0$" "$HOME/.$PKG/status" && exit 0
|
grep -qs -m1 "^$P=0$" "$HOME/.$PKG/status" && exit 0
|
||||||
;;
|
;;
|
||||||
# default = off, user must override to turn on
|
# default = off, user must override to turn on
|
||||||
arch|battery|ec2-cost|hostname|ip-address|network-down|network-up|processes|users|whoami|wifi-quality)
|
arch|battery|disk-available|disk-used|ec2-cost|hostname|ip-address|network-down|network-up|processes|users|whoami|wifi-quality)
|
||||||
grep -qs -m1 "^$P=1$" "$HOME/.$PKG/status" || exit 0
|
grep -qs -m1 "^$P=1$" "$HOME/.$PKG/status" || exit 0
|
||||||
;;
|
;;
|
||||||
--detail)
|
--detail)
|
||||||
|
|
6
debian/changelog
vendored
6
debian/changelog
vendored
|
@ -4,6 +4,10 @@ byobu (2.1) unreleased; urgency=low
|
||||||
* byobu-status, debian/rules: migrate existing screen-profiles config
|
* byobu-status, debian/rules: migrate existing screen-profiles config
|
||||||
dir smoothly by linking the old screen-profiles-status script to the
|
dir smoothly by linking the old screen-profiles-status script to the
|
||||||
new byobu-status, and add a migrate function to that script
|
new byobu-status, and add a migrate function to that script
|
||||||
|
* bin/disk-available, bin/disk-used, byobu-config, byobu-config.1,
|
||||||
|
byobu-status, profiles/common, profiles/profile.skel: add a new
|
||||||
|
pair of status notifications for disk space available and used;
|
||||||
|
default to / directory, allow user override in config dir
|
||||||
|
|
||||||
Tranform byobu-status --detail to use vim's folding feature
|
Tranform byobu-status --detail to use vim's folding feature
|
||||||
* byobu-status: output text compatible with vim's folding feature
|
* byobu-status: output text compatible with vim's folding feature
|
||||||
|
@ -26,7 +30,7 @@ byobu (2.1) unreleased; urgency=low
|
||||||
* bin/users: grep out the grep statement in the ps
|
* bin/users: grep out the grep statement in the ps
|
||||||
* bin/whoami: print /etc/passwd info on --detail
|
* bin/whoami: print /etc/passwd info on --detail
|
||||||
|
|
||||||
-- Dustin Kirkland <kirkland@ubuntu.com> Thu, 07 May 2009 00:25:39 -0500
|
-- Dustin Kirkland <kirkland@ubuntu.com> Thu, 07 May 2009 00:54:43 -0500
|
||||||
|
|
||||||
byobu (2.0-0ubuntu1) karmic; urgency=low
|
byobu (2.0-0ubuntu1) karmic; urgency=low
|
||||||
|
|
||||||
|
|
|
@ -50,6 +50,8 @@ backtick 119 2 2 byobu-status wifi-quality
|
||||||
backtick 120 86400 86400 byobu-status date
|
backtick 120 86400 86400 byobu-status date
|
||||||
backtick 121 86400 86400 byobu-status time
|
backtick 121 86400 86400 byobu-status time
|
||||||
backtick 122 3600 3600 byobu-status ip-address
|
backtick 122 3600 3600 byobu-status ip-address
|
||||||
|
backtick 123 86400 86400 byobu-status disk-available
|
||||||
|
backtick 124 2 2 byobu-status disk-used
|
||||||
|
|
||||||
hardstatus alwayslastline
|
hardstatus alwayslastline
|
||||||
|
|
||||||
|
|
|
@ -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`"
|
caption always "%{kW}%?%-Lw%?%{bw}%n*%f %t%?(%u)%?%{kW}%?%+Lw%? %= %{= Wk}%110`%109`%122`%111`"
|
||||||
|
|
||||||
# Status string, last line
|
# Status string, last line
|
||||||
hardstatus string '%99`%{= Wk} %100`%112`%= %102`%101`%114`%115`%108`%113`%119`%117`%118`%116`%106`%104`%103`%105`%107`%120`%121`'
|
hardstatus string '%99`%{= Wk} %100`%112`%= %102`%101`%114`%115`%108`%113`%119`%117`%118`%116`%106`%104`%103`%105`%107`%123`%124`%120`%121`'
|
||||||
|
|
||||||
# NOTE: Older version of screen have an arbitrary limit of only being able
|
# NOTE: Older version of screen have an arbitrary limit of only being able
|
||||||
# to change colors 16 times in this 'hardstatus string'.
|
# to change colors 16 times in this 'hardstatus string'.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue