← Back to team overview

sslug-teknik team mailing list archive

Re: prompt + resterende batteri

 

On Fri, 29 Mar 2002, Anders Bruun Olsen wrote:

> Her er de rettede scripts til dem der måtte være interesserede:

Kunne ikke nære mig for at:

> 
> /usr/bin/connected:
> #!/bin/sh
> STATUS=`cat /proc/apm | cut -d ' ' -f4`
> if  [  "$STATUS" = "0x01"  ];  then
>   echo "+"
> elif  [  "$STATUS" = "0x00"  ];  then
>   echo "-"
> fi

Kan vel skrives som noget i stil med
cut -d' ' -f4 /proc/apm | sed -e s/0x00/-/ -e s/0x01/+/

> 
> /usr/bin/battery:
> #!/bin/sh
> cat /proc/apm | cut -d ' ' -f7 | sed 's/%//'
cut -d ' ' -f7 /proc/apm | sed s/%//

Mads

-- 
Mads Bondo Dydensborg.                               madsdyd@xxxxxxxxxxxx
The IETF has an interesting enough life as is getting the "too simple" 
protocols to work sanely, hardware/software providers and sysadmins have a hard
time understanding, implementing and exploiting the "too simple" stuff today.
I.e., imagine MS-mess but on Internet scale, not just desktop-scale. If you
can. ... Scary. Real scary. Halloween stuff, definitely.
                                        - Dr. Horst H. von Brand



Follow ups

References