Commit | Line | Data |
---|---|---|
1 | #! /bin/sh | |
2 | ||
3 | set -e | |
4 | ||
5 | screen_brightness_device_path="$1" | |
6 | ||
7 | awk ' | |
8 | BEGIN { | |
9 | OFS = msg_fs ? msg_fs : "|" | |
10 | Kfs = key_fs ? key_fs : ":" | |
11 | } | |
12 | ||
13 | FILENAME ~ "/max_brightness$" {max = $1; next} | |
14 | FILENAME ~ "/brightness$" {cur = $1; next} | |
15 | END {print("percentage", (cur / max) * 100)} | |
16 | ' \ | |
17 | "$screen_brightness_device_path/max_brightness" \ | |
18 | "$screen_brightness_device_path/brightness" |