From 7e507c70ff2d8d8cd4c5b1f704e3cc388d351e23 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 9 Oct 2012 11:14:29 +0200 Subject: time for java --- adjbacklight.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'adjbacklight.py') diff --git a/adjbacklight.py b/adjbacklight.py index 0d07f46..b915114 100755 --- a/adjbacklight.py +++ b/adjbacklight.py @@ -20,7 +20,7 @@ This is the mane class of the program ''' class Adjbacklight(): def __init__(self): - Popen('stty -icanon'.split(' ')).wait() + #Popen('stty -icanon'.split(' '), stderr=os.fdopen(2, 'w')).wait() try: dir = '/sys/class/backlight/intel_backlight/' (size, dummy) = Popen('stty size'.split(' '), stdout=PIPE, stderr=PIPE).communicate() @@ -29,9 +29,15 @@ class Adjbacklight(): current = int(file.readline().replace('\n', '')) with open(dir + 'max_brightness', 'r') as file: max = int(file.readline().replace('\n', '')) - + self.__interface(0, current, max, width, dir + 'brightness') finally: - Popen('stty icanon'.split(' ')).wait() + pass#Popen('stty icanon'.split(' '), stderr=os.fdopen(2, 'w')).wait() + + def __interface(self, min, cur, max, width, file): + step = (max - min) // 100 + while (True): + print(sys.stdin.buffer.read1()) + ''' -- cgit v1.2.3-70-g09d2