diff options
author | Shubham Saini <pryr@pryr.xyz> | 2020-08-01 10:36:14 +0000 |
---|---|---|
committer | Shubham Saini <pryr@pryr.xyz> | 2020-08-01 10:36:14 +0000 |
commit | 27f907852934c855c6b9d5cec5c8c7990c5da97c (patch) | |
tree | 4149a879c8c945bc102fd66b74597b89c945de50 | |
parent | aa1fbe12aec99cecd90f2e7ea21d8ab2110ac4ba (diff) |
added brightness wrapper
-rwxr-xr-x | bin/.local/bin/light | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/bin/.local/bin/light b/bin/.local/bin/light new file mode 100755 index 0000000..b34150f --- /dev/null +++ b/bin/.local/bin/light | |||
@@ -0,0 +1,19 @@ | |||
1 | #!/bin/sh | ||
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 | |||