diff options
| author | Mitch Riedstra <mitch@riedstra.us> | 2020-11-01 13:34:40 -0500 |
|---|---|---|
| committer | Mitch Riedstra <mitch@riedstra.us> | 2020-11-01 22:22:13 -0500 |
| commit | 55d75452c658f2a46c439d0d632b626f1889b612 (patch) | |
| tree | 8716ad9996fbff8191751b77fe465aebf412abb0 /bin/backlight | |
| parent | b8d5cf5b393c6373b3dbfa5b1baf3e527de3e05b (diff) | |
| download | dotfiles-55d75452c658f2a46c439d0d632b626f1889b612.tar.gz dotfiles-55d75452c658f2a46c439d0d632b626f1889b612.tar.xz | |
Add backlight script. Also add status-bar and update my git configuration.
Diffstat (limited to 'bin/backlight')
| -rwxr-xr-x | bin/backlight | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/bin/backlight b/bin/backlight new file mode 100755 index 0000000..4df3636 --- /dev/null +++ b/bin/backlight @@ -0,0 +1,14 @@ +#!/bin/sh +set -e +set -x +# Note the trailing slash +# base="/sys/class/backlight/amdgpu_bl0/" +base="/sys/class/backlight/intel_backlight/" +_backlight="${base}brightness" +_max="${base}max_brightness" +_max="$(cat "$_max" | awk '{print $1/100;}')" + +percent="$(echo "$1" | awk '{print int($1*'"$_max"');}')" + +sudo sh -c "echo \"$percent\" > $_backlight" + |
