High, high ...
* Frank Terbeck <[EMAIL PROTECTED]> schrieb am [18.09.08 19:01]:
> Kai Wilke <[EMAIL PROTECTED]>:
> > to works (my configuration /etc/zsh/zshrc):
> >
> > battery()
> > {
>
> I minor nitpick: the rest of the functions in that files uses
> 'functname() {' and I think we should stay consistent.
Another way (consistent?):
# {{{ display battery status on right side of prompt via running 'BATTERY=1 zsh'
if [[ $BATTERY == 1 ]] ; then
if ! check_com -c acpi ; then
BATTERY=0
fi
fi
# Benoetigt das paket acpi.
battery()
{
if [[ $BATTERY == 1 ]] ; then
PERCENT=${${"$(acpi 2>/dev/null)"}/(#b)[[:space:]]##Battery <->: [^0-9]##,
(<->)%*/${match[1]}}
if [[ -z "$PERCENT" ]] ; then
PERCENT='acpi not present'
else
if [[ "$PERCENT" -lt 20 ]] ; then
PERCENT="warning: ${PERCENT}%%"
else
PERCENT="${PERCENT}%%"
fi
fi
fi
}
# }}}
PERCENT is not ever integer. See Code:
,----[ Line 946 ]
| [[ -z "$PERCENT" ]] && PERCENT='acpi not present'
|
| if [[ "${PERCENT%%%}" -lt 20 ]] ; then
| PERCENT="warning: ${PERCENT}%"
| fi
`----
>
> [...]
mfg Kiste
--
#######################################################################
Netzworkk grml - Linux Live CD fuer Sysadmins
Kai Wilke http://grml.org
[EMAIL PROTECTED]
http://www.netzworkk.de
http://netzworkk.berlios.de
signature.asc
Description: Digital signature
_______________________________________________ Grml mailing list - [email protected] http://lists.mur.at/mailman/listinfo/grml join #grml on irc.freenode.org grml-devel-blog: http://grml.supersized.org/
