diff options
author | Shubham Saini <pryr@pryr.xyz> | 2020-12-01 20:21:04 +0000 |
---|---|---|
committer | Shubham Saini <pryr@pryr.xyz> | 2020-12-01 20:21:04 +0000 |
commit | 1ff834e2b06761b083df9959d6c3d6bd2a94d2de (patch) | |
tree | abb8ff13bab1c6b5a0c0b17f2d29c058358d2135 /bin/.bin/light | |
parent | 90e96958f919df1f914381e93a97d77506fdcf03 (diff) |
mah thinkpad
Diffstat (limited to 'bin/.bin/light')
-rwxr-xr-x | bin/.bin/light | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/bin/.bin/light b/bin/.bin/light new file mode 100755 index 0000000..bba7e82 --- /dev/null +++ b/bin/.bin/light | |||
@@ -0,0 +1,19 @@ | |||
1 | #!/bin/bash | ||
2 | # brightness wrapper | ||
3 | |||
4 | case "$1" in | ||
5 | u*) | ||
6 | for f in /sys/class/backlight/*; do | ||
7 | echo $(($(<$f/brightness)+5*$(<$f/max_brightness)/100)) > $f/brightness; | ||
8 | done | ||
9 | ;; | ||
10 | d*) | ||
11 | for f in /sys/class/backlight/*; do | ||
12 | echo $(($(<$f/brightness)-5*$(<$f/max_brightness)/100)) > $f/brightness; | ||
13 | done | ||
14 | ;; | ||
15 | *) | ||
16 | echo "choose u or d" | ||
17 | ;; | ||
18 | esac | ||
19 | |||