The Lumber Room

"Consign them to dust and damp by way of preserving them"

Posts Tagged ‘alert

Flashing the screen on Mac OS X

with 2 comments

Here’s one way. There’s a C program to adjust the screen’s brightness written by Nicholas Riley, also available from this blog post by Matt (Danger) West. Get it. The rest is obvious. For instance, here’s a Python script, which should have probably been written in Perl:

import os, re, time

s = os.popen('./brightness -l').read()
ob = re.findall('brightness (\d.\d+)', s)[0]

w = 0.2
for i in range(10):
    os.system('./brightness 0'); time.sleep(w)
    os.system('./brightness 1'); time.sleep(w)
    if(i==4): os.system("say beep")

os.system('./brightness ' + ob)

Tune parameters to avoid epileptic seizures.

Read the rest of this entry »

Advertisements

Written by S

Mon, 2009-08-17 at 16:07:05

Posted in compknow

Tagged with , , , ,