diff options
author | Mattias Andrée <maandree@operamail.com> | 2012-10-09 11:14:29 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2012-10-09 11:14:29 +0200 |
commit | 7e507c70ff2d8d8cd4c5b1f704e3cc388d351e23 (patch) | |
tree | e4546ff35bb64f1e8b9f1604f0aad9e9d7ea9a41 | |
parent | turn on and off icanon + get terminal width + get maximum and current brightness (diff) | |
download | adjbacklight-7e507c70ff2d8d8cd4c5b1f704e3cc388d351e23.tar.gz adjbacklight-7e507c70ff2d8d8cd4c5b1f704e3cc388d351e23.tar.bz2 adjbacklight-7e507c70ff2d8d8cd4c5b1f704e3cc388d351e23.tar.xz |
time for java
Diffstat (limited to '')
-rwxr-xr-x | adjbacklight.py | 12 |
1 files changed, 9 insertions, 3 deletions
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()) + ''' |