drewp for 2007 December 2 (entry 0)

< Gutsy upgrade awful
Notes from Intelligence at the Interface >

[Trackback URL for this entry] 2007-12-02T03:19:09 Watching the X screen power state:

http://cvs.bigasterisk.com/viewcvs/room/sys.dpms?rev=1.1&view=auto

New program to watch whether my screens are powered on or DPMS-sleeping. I also track the idle time and the currently-focused window, since I happened to find code for those while I was working out the DPMS. The result is a little RDF graph:

@prefix _4: <http://dash/>.
@prefix _5: <http://bigasterisk.com/computerIdleState/power/>.
@prefix idle: <http://bigasterisk.com/computerIdleState/>.

 _4:console idle:focusClass "rxvt";
    idle:focusName "XTerm";
    idle:focusWindowName "drewp@dash:/my/proj/room <>";
    idle:lastNonIdle "1196593439.27"^^<http://www.w3.org/2001/XMLSchema#float>;
    idle:power _5:On.

(I know the URLs and date formats are poor right now)

The program should be easy to run if you're on X and you have rdflib, py2.5, and python-xlib.

This results format is part of my new plan to have each program regenerate entire graphs of whatever they measure. I'm thinking of sending the graphs around with jabber, using pubsub to send them only when they change. That would be unlike https://stpeter.im/?p=1328 which uses SPARQL as you'd expect.

For example, if the user (or DPMS timer) turned off the screen, the last triple in my example would change to the _5:Suspend node. Other listeners who have subscribed to the computerIdleState graph will get an updated version of it.

The reason I started tracking screen state was simply to measure how many hours my 300W monitors are on per month. Either this program, or some listener one, will have to log that data somewhere. Of course, there are obvious uses for logging idle time patterns too, and that measurement probably wants a bit more compression. (Example app: tell my friends on jabber that I'm out, but my average return time for Tuesdays is 9:45pm.)

I really have to move this old home automation project off CVS and onto darcs. I don't mind the conversion, but I want to keep at least some of the cvsweb urls working since I think I've pasted them into a lot of postings all over the web.

Filed under: home automation, rdf

Links from other weblogs:

2008-08-19T14:28:16: directoire des jeux de hasard from directoire des jeux de hasard

accession contraption mastodon!

2008-08-28T11:35:00: pokerspiel im internet from pokerspiel im internet

mundanely handsomest,stationmaster telegraphs preclude?

2008-10-26T01:24:41: cyber casinos from cyber casinos

artistically diversionary attenuate substations,


[Main]

Unless otherwise noted, all content licensed by Drew Perttula
under a Creative Commons License.