mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-21 14:03:18 -07:00
added load-average and mem-available status bar items
This commit is contained in:
parent
6a1e3fe1b1
commit
12551449f7
8 changed files with 34 additions and 7 deletions
|
@ -4,5 +4,5 @@ count=`grep -c "^processor.*:" /proc/cpuinfo`
|
|||
if [ "$count" = "1" ]; then
|
||||
echo
|
||||
else
|
||||
echo $count"x "
|
||||
echo $count"x"
|
||||
fi
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
mhz=`grep -m 1 "^cpu MHz" /proc/cpuinfo | sed "s/^.*: //" | sed "s/\..*$//"`
|
||||
if [ $mhz -gt 1000 -a -x /usr/bin/bc ]; then
|
||||
ghz=$(echo "scale=1; $mhz/1000" | bc)
|
||||
echo "$ghz GHz"
|
||||
echo "$ghz""GHz"
|
||||
else
|
||||
echo "$mhz MHz"
|
||||
echo "$mhz""MHz"
|
||||
fi
|
||||
|
|
3
bin/load-average
Executable file
3
bin/load-average
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
cat /proc/loadavg | cut -d " " -f -1
|
12
bin/mem-available
Executable file
12
bin/mem-available
Executable file
|
@ -0,0 +1,12 @@
|
|||
#!/bin/sh
|
||||
|
||||
mem=`grep -m 1 "^MemTotal:" /proc/meminfo | sed 's/ kB$//' | sed 's/^.* //'`
|
||||
if [ $mem -gt 1000000 -a -x /usr/bin/bc ]; then
|
||||
mem=$(echo "scale=1; $mem/1000000" | bc)
|
||||
echo "$mem""GB"
|
||||
elif [ $mem -gt 1000 -a -x /usr/bin/bc ]; then
|
||||
mem=$(echo "scale=1; $mem/1000" | bc)
|
||||
echo "$mem""MB"
|
||||
else
|
||||
echo "$mem""KB"
|
||||
fi
|
8
debian/changelog
vendored
8
debian/changelog
vendored
|
@ -1,8 +1,12 @@
|
|||
screen-profiles (1.5) UNRELEASED; urgency=low
|
||||
|
||||
*
|
||||
[ Dustin Kirkland ]
|
||||
* bin/mem-available: added a memory count script
|
||||
* bin/load-average: added a load average script
|
||||
* debian/install, profiles/common, profiles/ubuntu.screenrc:
|
||||
updated with mem and load status scripts
|
||||
|
||||
-- Dustin Kirkland <kirkland@ubuntu.com> Wed, 07 Jan 2009 17:44:59 -0600
|
||||
-- Dustin Kirkland <kirkland@ubuntu.com> Fri, 09 Jan 2009 14:42:08 -0600
|
||||
|
||||
screen-profiles (1.4-0ubuntu1) jaunty; urgency=low
|
||||
|
||||
|
|
2
debian/install
vendored
2
debian/install
vendored
|
@ -1,5 +1,7 @@
|
|||
bin/cpu-count usr/share/screen-profiles/bin
|
||||
bin/cpu-freq usr/share/screen-profiles/bin
|
||||
bin/load-average usr/share/screen-profiles/bin
|
||||
bin/mem-available usr/share/screen-profiles/bin
|
||||
bin/reboot-required usr/share/screen-profiles/bin
|
||||
bin/release usr/share/screen-profiles/bin
|
||||
bin/updates-available usr/share/screen-profiles/bin
|
||||
|
|
|
@ -27,7 +27,9 @@ backtick 100 3600 3600 /usr/share/screen-profiles/bin/release
|
|||
backtick 101 3600 3600 /usr/share/screen-profiles/bin/updates-available
|
||||
backtick 102 10 10 /usr/share/screen-profiles/bin/reboot-required
|
||||
backtick 103 5 5 /usr/share/screen-profiles/bin/cpu-freq
|
||||
backtick 104 999999 999999 /usr/share/screen-profiles/bin/cpu-count
|
||||
backtick 104 3600 3600 /usr/share/screen-profiles/bin/cpu-count
|
||||
backtick 105 3600 3600 /usr/share/screen-profiles/bin/mem-available
|
||||
backtick 106 5 5 /usr/share/screen-profiles/bin/load-average
|
||||
|
||||
hardstatus alwayslastline
|
||||
|
||||
|
|
|
@ -21,4 +21,8 @@
|
|||
|
||||
source /usr/share/screen-profiles/profiles/common
|
||||
|
||||
hardstatus string '%{Wk} %{= Wk}%{+b r}\%{= Wy}o%{=b WY}/%{+b Wk} %100` %{= Wk}|%= |%{+B bW}%102`%{= Wk}|%{+b rW}%101`%{= Wk}|%{k}%104`%{+b gW}%103`%{= Wk}|%{= Wk}%Y-%m-%d %c:%s'
|
||||
hardstatus string '%{+b Wr}\%{= Wy}o%{=b WY}/%{=b Wk} %100` %{= Wk}|%= |%{=B bW}%102`%{= Wk}|%{=b rW}%101`%{= Wk}|%{= Yk}%106`%{= Wk}|%{= Wk}%104`%{=b gW}%103`%{= Wk} %{=b gW}%105`%{= Wk}|%Y-%m-%d %c:%s'
|
||||
|
||||
# NOTE: There's a strange limit of only being able to change colors 16 times
|
||||
# in this 'hardstatus string'. Probably need to increase the size of some
|
||||
# data structure in the screen code itself.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue