diff --git a/debian/changelog b/debian/changelog index 3723fe10..429c853c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,9 @@ byobu (4.55) unreleased; urgency=low - * UNRELEASED + * usr/lib/byobu/entropy, usr/lib/byobu/include/shutil, + usr/lib/byobu/Makefile.am, usr/share/byobu/status/status, + usr/share/man/man1/byobu.1: + - add a system entropy status item -- Dustin Kirkland Fri, 09 Dec 2011 20:38:02 -0600 diff --git a/usr/lib/byobu/Makefile.am b/usr/lib/byobu/Makefile.am index ac4580c2..80dcbecf 100644 --- a/usr/lib/byobu/Makefile.am +++ b/usr/lib/byobu/Makefile.am @@ -1,3 +1,3 @@ libdirdir = $(prefix)/lib/@PACKAGE@ -libdir_SCRIPTS = apport arch battery cpu_count cpu_freq cpu_temp color custom date disk disk_io distro ec2_cost fan_speed hostname ip_address load_average logo mail memory menu network processes raid rcs_cost reboot_required release services swap time time_binary time_utc trash updates_available uptime users whoami wifi_quality +libdir_SCRIPTS = apport arch battery cpu_count cpu_freq cpu_temp color custom date disk disk_io distro entropy ec2_cost fan_speed hostname ip_address load_average logo mail memory menu network processes raid rcs_cost reboot_required release services swap time time_binary time_utc trash updates_available uptime users whoami wifi_quality diff --git a/usr/lib/byobu/entropy b/usr/lib/byobu/entropy new file mode 100755 index 00000000..d40cf494 --- /dev/null +++ b/usr/lib/byobu/entropy @@ -0,0 +1,31 @@ +#!/bin/sh -e +# +# entropy: system entropy +# +# Copyright (C) 2011 Dustin Kirkland +# +# 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 . + +__entropy_detail() { + cat /proc/sys/kernel/random/entropy_avail +} + +__entropy() { + local e + read e < /proc/sys/kernel/random/entropy_avail + color k r; printf "e$e"; color -- +} + +# vi: syntax=sh ts=4 noexpandtab diff --git a/usr/lib/byobu/include/shutil b/usr/lib/byobu/include/shutil index aadd5de1..61d59ef1 100755 --- a/usr/lib/byobu/include/shutil +++ b/usr/lib/byobu/include/shutil @@ -248,6 +248,7 @@ status_freq() { disk_io) _RET=3 ;; distro) _RET=9999999 ;; ec2_cost) _RET=601 ;; + entropy) _RET=5 ;; fan_speed) _RET=23 ;; hostname) _RET=607 ;; ip_address) _RET=127 ;; diff --git a/usr/share/byobu/status/status b/usr/share/byobu/status/status index 7528a4f6..19e65cf5 100644 --- a/usr/share/byobu/status/status +++ b/usr/share/byobu/status/status @@ -26,8 +26,8 @@ screen_upper_left="color" screen_upper_right="color whoami hostname ip_address menu" screen_lower_left="color logo distro release #arch" -screen_lower_right="color network #disk_io custom raid reboot_required updates_available #apport #services #mail users uptime #ec2_cost #rcs_cost #fan_speed #cpu_temp battery wifi_quality #processes load_average cpu_count cpu_freq memory #swap #disk #time_utc date time" +screen_lower_right="color network #disk_io custom #entropy raid reboot_required updates_available #apport #services #mail users uptime #ec2_cost #rcs_cost #fan_speed #cpu_temp battery wifi_quality #processes load_average cpu_count cpu_freq memory #swap #disk #time_utc date time" # Tmux has one status line, with 2 halves for status tmux_left="logo #distro release #arch" -tmux_right="network #disk_io custom raid reboot_required updates_available #apport #services #mail users uptime #ec2_cost #rcs_cost #fan_speed #cpu_temp battery wifi_quality #processes load_average cpu_count cpu_freq memory #swap #disk #whoami #hostname #ip_address #time_utc date time" +tmux_right="network #disk_io custom #entropy raid reboot_required updates_available #apport #services #mail users uptime #ec2_cost #rcs_cost #fan_speed #cpu_temp battery wifi_quality #processes load_average cpu_count cpu_freq memory #swap #disk #whoami #hostname #ip_address #time_utc date time" diff --git a/usr/share/man/man1/byobu.1 b/usr/share/man/man1/byobu.1 index 11dfbedd..2c29bd14 100644 --- a/usr/share/man/man1/byobu.1 +++ b/usr/share/man/man1/byobu.1 @@ -47,6 +47,8 @@ Note that BYOBU_CONFIG_DIR=\fI$XDG_CONFIG_HOME/byobu\fP if defined, and \fI$HOME \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 black background; there is a leading '~' to indicate that this is an estimation, and the monetary units are US Dollars '$' +\fBentropy\fP \- a count of the system's current entropy in bytes; displayed in the lower bar toward the right in red text on a black background; there is a leading 'e' to indicate 'entropy' + \fBraid\fP \- note very prominently if there is a RAID failure detected, in red blinking text on a white background; the term 'RAID' notes that there is something wrong with the RAID, and if there is a rebuild/resync in progress, the percent complete is also shown \fBrcs_cost\fP \- an estimation of the cost of the current boot of the system in terms of the Rackspace Cloud Server billing model; displayed in the lower bar toward the right in green text on a black background; there is a leading '~' to indicate that this is an estimation, and the monetary units are US Dollars '$'