diff options
| author | Alec Goncharow <alec.goncharow@gmail.com> | 2018-10-07 13:54:13 -0400 |
|---|---|---|
| committer | Alec Goncharow <alec.goncharow@gmail.com> | 2018-10-07 13:54:13 -0400 |
| commit | 2825fe0b91dc8f8abb318c83b85f893c35852e69 (patch) | |
| tree | 43cf9cb085692efb7038a7f728263276cae6e0d4 /.config/i3/dec_brightness.py | |
| parent | dc3939e1d6ade0b378837e4f6b427273d4a5c227 (diff) | |
saving desktop config for reinstall
Diffstat (limited to '.config/i3/dec_brightness.py')
| -rw-r--r-- | .config/i3/dec_brightness.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/.config/i3/dec_brightness.py b/.config/i3/dec_brightness.py new file mode 100644 index 0000000..a4b3757 --- /dev/null +++ b/.config/i3/dec_brightness.py @@ -0,0 +1,16 @@ +#!/usr/bin/python3 + +import subprocess + +backlight_dir = '/sys/class/backlight/intel_backlight/' + +brightness_file = 'brightness' +max_brightness_file = 'max_brightness' + +brightness = int(open(backlight_dir + brightness_file).read()) +max_brightness = int(open(backlight_dir + max_brightness_file).read()) +ratio = (brightness / max_brightness) +brightness = ratio * 100 + +if brightness > 6: + subprocess.call("xbacklight -set {}".format(brightness - 5), shell=True) |
