mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-21 22:13:19 -07:00
[ Dustin Kirkland ]
bin/*, profiles/profile.skel: make all status scripts handle their own colors and trailing whitespace; this should help alleviate the 16-color-change limitation on un-patched screens; it also simplifies the hardstatus string significantly -Dustin Kirkland <kirkland@ubuntu.com>Fri, 03 Apr 2009 12:06:45 -0500
This commit is contained in:
parent
f4d6f7dc65
commit
4843026f24
18 changed files with 39 additions and 31 deletions
|
@ -25,7 +25,7 @@ mhz=`grep -m 1 "^cpu MHz" /proc/cpuinfo | awk -F"[:.]" '{print $2}'` || mhz=`gre
|
|||
|
||||
if [ $mhz -ge 1000 ]; then
|
||||
ghz=$(echo $mhz | awk '{ printf "%.2f", $1 / 1000 }')
|
||||
echo $ghz"GHz"
|
||||
printf "\005{=b cW}%sGHz\005{-} " $ghz
|
||||
else
|
||||
echo $mhz"MHz"
|
||||
printf "\005{=b cW}%sMHz\005{-} " $mhz
|
||||
fi
|
||||
|
|
|
@ -95,4 +95,4 @@ if [ "$DETAIL" = "1" ]; then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
echo $total_cost
|
||||
printf "\005{= Wg}%s\005{-} " $total_cost
|
||||
|
|
|
@ -20,5 +20,7 @@
|
|||
# Default is "off"
|
||||
p="hostname"
|
||||
grep -qs "^$p=1$" "$HOME/.screen-profiles/status" || exit 0
|
||||
at=
|
||||
grep -qs "^whoami=1$" "$HOME/.screen-profiles/status" && at="@"
|
||||
|
||||
echo "@"`hostname -s`
|
||||
printf "\005{=b }%s%s\005{-}" "$at" $(hostname -s)
|
||||
|
|
|
@ -21,4 +21,4 @@
|
|||
p="load-average"
|
||||
grep -qs "^$p=0$" "$HOME/.screen-profiles/status" && exit 0
|
||||
|
||||
cat /proc/loadavg | cut -d " " -f -1
|
||||
printf "\005{= Yk}%s\005{-} " $(cat /proc/loadavg | cut -d " " -f -1)
|
||||
|
|
|
@ -20,14 +20,16 @@
|
|||
# Default is on
|
||||
p="mem-available"
|
||||
grep -qs "^$p=0$" "$HOME/.screen-profiles/status" && exit 0
|
||||
comma=
|
||||
whitespace=
|
||||
grep -qs "^mem-used=1$" "$HOME/.screen-profiles/status" && comma="," || whitespace=" "
|
||||
|
||||
mem=`free | grep -m 1 "^Mem:" | awk '{print $2}'`
|
||||
if [ $mem -ge 1048576 ]; then
|
||||
mem=$(echo "$mem" | awk '{ printf "%.1f", $1 / 1048576 }')
|
||||
echo "$mem""GB"
|
||||
mem=$(echo "$mem" | awk '{ printf "%.1fGB", $1 / 1048576 }')
|
||||
elif [ $mem -ge 1024 ]; then
|
||||
mem=$(echo "$mem" | awk '{ printf "%.0f", $1 / 1024 }')
|
||||
echo "$mem""MB"
|
||||
mem=$(echo "$mem" | awk '{ printf "%.0fMB", $1 / 1024 }')
|
||||
else
|
||||
echo "$mem""KB"
|
||||
mem="$mem""KB"
|
||||
fi
|
||||
printf "\005{=b gW}%s\005{-}%s" "$mem$comma" "$whitespace"
|
||||
|
|
|
@ -21,4 +21,4 @@
|
|||
p="mem-used"
|
||||
grep -qs "^$p=0$" "$HOME/.screen-profiles/status" && exit 0
|
||||
|
||||
free | awk '/buffers\/cache:/ {printf ",%.0f%%\n", 100*$3/($3 + $4)}'
|
||||
free | awk '/buffers\/cache:/ {printf "\005{=b gW}%.0f%%\005{-} ", 100*$3/($3 + $4)}'
|
||||
|
|
2
bin/menu
2
bin/menu
|
@ -21,4 +21,4 @@
|
|||
p="menu"
|
||||
grep -qs "^$p=0$" "$HOME/.screen-profiles/status" && exit 0
|
||||
|
||||
echo `gettext "Menu:<F9>"`
|
||||
printf " \005{= kw}%s" `gettext "Menu:<F9>"`
|
||||
|
|
|
@ -21,4 +21,4 @@
|
|||
p="reboot-required"
|
||||
grep -qs "^$p=0$" "$HOME/.screen-profiles/status" && exit 0
|
||||
|
||||
[ -e /var/run/reboot-required ] && echo "(@)"
|
||||
[ -e /var/run/reboot-required ] && printf "\005{=b bW}(@)\005{-} "
|
||||
|
|
|
@ -29,11 +29,11 @@ if which lsb_release >/dev/null; then
|
|||
else
|
||||
# But for other distros the description
|
||||
# is too long, so build from -i and -r
|
||||
echo $(lsb_release -s -i) $(lsb_release -s -r)
|
||||
printf "\005{=b }%s %s\005{-} " $(lsb_release -s -i) $(lsb_release -s -r)
|
||||
fi
|
||||
elif [ -r "/etc/issue" ]; then
|
||||
# Otherwise, grab part of /etc/issue
|
||||
head -n1 /etc/issue | awk '{print $1}'
|
||||
printf "\005{=b ..}%s\005{-} " $(head -n1 /etc/issue | awk '{print $1}')
|
||||
else
|
||||
echo "Unknown"
|
||||
fi
|
||||
|
|
|
@ -29,13 +29,13 @@ print_updates() {
|
|||
s=$2
|
||||
if [ -n "$u" ]; then
|
||||
if [ "$u" -gt 0 ]; then
|
||||
echo -n "$u"
|
||||
printf "\005{=b rW}%d" "$u"
|
||||
if [ -n "$s" ]; then
|
||||
if [ "$s" -gt 0 ]; then
|
||||
echo -n "!"
|
||||
printf "!"
|
||||
fi
|
||||
fi
|
||||
echo
|
||||
printf "\005{-} "
|
||||
fi
|
||||
fi
|
||||
exit 0
|
||||
|
|
|
@ -26,11 +26,11 @@ grep -qs "^$p=1$" "$HOME/.screen-profiles/status" || exit 0
|
|||
|
||||
u=$(sed "s/\..*$//" /proc/uptime)
|
||||
if [ "$u" -gt 86400 ]; then
|
||||
printf "%dd" `echo "$u" | awk '{printf "%.0f", $1 / 86400 }'`
|
||||
printf "%dd " `echo "$u" | awk '{printf "%.0f", $1 / 86400 }'`
|
||||
elif [ "$u" -gt 3600 ]; then
|
||||
printf "%dh" `echo "$u" | awk '{printf "%.0f", $1 / 3600 }'`
|
||||
printf "%dh " `echo "$u" | awk '{printf "%.0f", $1 / 3600 }'`
|
||||
elif [ "$u" -gt 60 ]; then
|
||||
printf "%dm" `echo "$u" | awk '{printf "%.0f", $1 / 60 }'`
|
||||
printf "%dm " `echo "$u" | awk '{printf "%.0f", $1 / 60 }'`
|
||||
else
|
||||
printf "%ds" "$u"
|
||||
printf "%ds " "$u"
|
||||
fi
|
||||
|
|
|
@ -24,4 +24,4 @@
|
|||
p="users"
|
||||
grep -qs "^$p=1$" "$HOME/.screen-profiles/status" || exit 0
|
||||
|
||||
printf "#%d\005{-} " `who | wc -l`
|
||||
printf "#%d " `who | wc -l`
|
||||
|
|
|
@ -21,4 +21,4 @@
|
|||
p="whoami"
|
||||
grep -qs "^$p=1$" "$HOME/.screen-profiles/status" || exit 0
|
||||
|
||||
whoami
|
||||
printf "\005{=b }%s\005{-}" $(whoami)
|
||||
|
|
8
debian/changelog
vendored
8
debian/changelog
vendored
|
@ -1,14 +1,18 @@
|
|||
screen-profiles (1.43) unreleased; urgency=low
|
||||
|
||||
* UNRELEASED
|
||||
[ Dustin Kirkland ]
|
||||
* bin/logo: allow users to define their own logo
|
||||
* bin/*, profiles/profile.skel: make all status scripts handle their
|
||||
own colors and trailing whitespace; this should help alleviate the
|
||||
16-color-change limitation on un-patched screens; it also simplifies
|
||||
the hardstatus string significantly
|
||||
|
||||
[ Raphaël Pinson and Dustin Kirkland ]
|
||||
* bin/battery, bin/users, bin/uptime, profiles/common, screen-profiles:
|
||||
added new status items for battery state, number of users, and system
|
||||
uptime
|
||||
|
||||
-- Dustin Kirkland <kirkland@ubuntu.com> Fri, 03 Apr 2009 10:45:36 -0500
|
||||
-- Dustin Kirkland <kirkland@ubuntu.com> Fri, 03 Apr 2009 12:06:45 -0500
|
||||
|
||||
screen-profiles (1.42-0ubuntu1) jaunty; urgency=low
|
||||
|
||||
|
|
2
po/es.po
2
po/es.po
|
@ -9,7 +9,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: 1.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2009-04-03 11:01-0500\n"
|
||||
"POT-Creation-Date: 2009-04-03 12:03-0500\n"
|
||||
"PO-Revision-Date: 2008-12-22 01:01-0500\n"
|
||||
"Last-Translator: Nicolas Valcarcel <nvalcarcel@ubuntu.com>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
|
2
po/fr.po
2
po/fr.po
|
@ -9,7 +9,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: 1.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2009-04-03 11:01-0500\n"
|
||||
"POT-Creation-Date: 2009-04-03 12:03-0500\n"
|
||||
"PO-Revision-Date: 2008-12-17 23:42+0100\n"
|
||||
"Last-Translator: Nicolas Barcet <nicolas.barcet@ubuntu.com>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
|
|
@ -9,7 +9,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2009-04-03 11:01-0500\n"
|
||||
"POT-Creation-Date: 2009-04-03 12:03-0500\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
|
|
@ -23,10 +23,10 @@
|
|||
source /usr/share/screen-profiles/profiles/common
|
||||
|
||||
# Window tabs, second to last line
|
||||
caption always "%{kW}%?%-Lw%?%{bw}%n*%f %t%?(%u)%?%{kW}%?%+Lw%? %= %{=b Wk}%110`%109` %{= kw}%111`"
|
||||
caption always "%{kW}%?%-Lw%?%{bw}%n*%f %t%?(%u)%?%{kW}%?%+Lw%? %= %{= Wk}%110`%109`%111`"
|
||||
|
||||
# Status string, last line
|
||||
hardstatus string '%99`%{=b Wk} %100` %{= Wk}%112` %= %113`%{=b Wk}%114`%{=b Wk}%115`%{=b Wk} %{=b bW}%102`%{= Wk} %{=b rW}%101`%{= Wk} %{= Wg}%108`%{= Wk} %{= Yk}%106`%{= Wk} %{= Wk}%104`%{=b cW}%103`%{= Wk} %{=b gW}%105`%107`%{= Wk} %Y-%m-%d %0c:%s'
|
||||
hardstatus string '%{= Wk}%99`%{= Wk} %100`%112`%= %115`%114`%108`%113`%102`%101`%106`%104`%103`%105`%107`%Y-%m-%d %0c:%s'
|
||||
|
||||
# NOTE: Older version of screen have an arbitrary limit of only being able
|
||||
# to change colors 16 times in this 'hardstatus string'.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue