User:MartinDengler: Difference between revisions

From OLPC
Jump to navigation Jump to search
(Initial page)
 
No edit summary
Line 1: Line 1:
{{Editor toc}}

== About Me ==
I program for a living and got an XO to support the OLPC project and have a laptop for daily use in one go.
I program for a living and got an XO to support the OLPC project and have a laptop for daily use in one go.


I work with python and Fedora a lot.
I work with python and Fedora a lot.


== Screen battery status hint ==


The only thing I've ever contributed so far is a tiny developer-only hint:
The only thing I've ever contributed so far is a tiny developer-only hint:

Revision as of 00:31, 10 January 2008

Template:Editor toc

About Me

I program for a living and got an XO to support the OLPC project and have a laptop for daily use in one go.

I work with python and Fedora a lot.


Screen battery status hint

The only thing I've ever contributed so far is a tiny developer-only hint:

Date: Sat, 5 Jan 2008 18:09:19 +0000
From: Martin Dengler <martin@martindengler.com>
Subject: Battery capacity in screen hardstatus line hint
To: devel@lists.laptop.org

[-- PGP output follows (current time: Sat 05 Jan 2008 06:23:51 PM GMT) --]
gpg: Signature made Sat 05 Jan 2008 06:09:19 PM GMT using DSA key ID 75C7D2F8
[GNUPG:] SIG_ID AwM6Me4nlHAq/mT0qRJbz79n4sk 2008-01-05 1199556559
[GNUPG:] GOODSIG 81B444DD75C7D2F8 martin@martindengler.com
gpg: Good signature from "martin@martindengler.com"
[GNUPG:] VALIDSIG 565C8F33ABF72DAA33DEB9CB81B444DD75C7D2F8 2008-01-05 1199556559 0 3 0 17 2 01 565C8F33ABF72DAA33DEB9CB81B444DD75C7D2F8
[GNUPG:] TRUST_ULTIMATE
[-- End of PGP output --]

[-- The following data is signed --]

Hi,

In case this is of use to anyone, I've put the battery capacity in my
xo screen instance's hardstatus line with this tiny script & screenrc
change:

---------- /home/olpc/bin/olpc_screen_status.sh
#!/bin/bash
# Author: Martin Dengler <martin@martindengler.com>
# idea from http://www.mail-archive.com/screen-users@gnu.org/msg00322.html
# based on battery info from olpc-logbat
#
B_INFO=/sys/class/power_supply/olpc-battery

while true
do
    CAP=`cat $B_INFO/capacity`
    echo b:$CAP%
    sleep 60
done
----------

....screenrc change:

---------- /home/olpc/bin/.screenrc
# run command forever and assign most recent output to string escape %1`  
backtick 1 0 0 /home/olpc/bin/olpc_screen_status.sh

# the ...%1`... part at the end is the important part
hardstatus alwayslastline "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a %1` "
----------

I'd be interested to know how to get at the ambient temperature sensor mentioned in section 2.4.1 of the CL1 hardware design specification PDF. I've had a look around /sys/class but nothing's jumped out at me.