From 55d75452c658f2a46c439d0d632b626f1889b612 Mon Sep 17 00:00:00 2001 From: Mitch Riedstra Date: Sun, 1 Nov 2020 13:34:40 -0500 Subject: Add backlight script. Also add status-bar and update my git configuration. --- bin/backlight | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 bin/backlight (limited to 'bin/backlight') 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" + -- cgit v1.2.3