screen-profiles-status: stop grepping after one match, subtle perf

improvement
-Dustin Kirkland <kirkland@ubuntu.com>Fri, 17 Apr 2009 16:33:53 -0500
This commit is contained in:
Dustin Kirkland 2009-04-17 16:49:30 -05:00
commit fd906813ac
2 changed files with 5 additions and 4 deletions

5
debian/changelog vendored
View file

@ -1,8 +1,9 @@
screen-profiles (1.47) unreleased; urgency=low
* UNRELEASED
* screen-profiles-status: stop grepping after one match, subtle perf
improvement
-- Dustin Kirkland <kirkland@ubuntu.com> Fri, 17 Apr 2009 15:47:15 -0500
-- Dustin Kirkland <kirkland@ubuntu.com> Fri, 17 Apr 2009 16:33:53 -0500
screen-profiles (1.46-0ubuntu1) jaunty; urgency=low

View file

@ -39,11 +39,11 @@ P="$1"
case "$P" in
# default = on, user must override to turn off
cpu-count|cpu-freq|date|load-average|logo|mem-available|mem-used|menu|reboot-required|release|time|updates-available)
grep -qs "^$P=0$" "$HOME/.screen-profiles/status" && exit 0
grep -qs -m1 "^$P=0$" "$HOME/.screen-profiles/status" && exit 0
;;
# default = off, user must override to turn on
arch|battery|ec2-cost|hostname|network-down|network-up|processes|uptime|users|whoami|wifi-quality)
grep -qs "^$P=1$" "$HOME/.screen-profiles/status" || exit 0
grep -qs -m1 "^$P=1$" "$HOME/.screen-profiles/status" || exit 0
;;
*)
exit 1