From f4f32533c347a4c4242122d802c53fb6d7c01e7e Mon Sep 17 00:00:00 2001 From: Thierry Schork Date: Thu, 10 Jul 2025 20:29:38 +0200 Subject: [PATCH] Added laptop brightness script --- bin/brightness | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 bin/brightness diff --git a/bin/brightness b/bin/brightness new file mode 100755 index 0000000..16ad15a --- /dev/null +++ b/bin/brightness @@ -0,0 +1,24 @@ +#!/bin/fish + +set backlight_device $argv[1] +set action $argv[2] +set dvalue $argv[3] + +echo Backlight device: $backlight_device Bumping: $action By: $dvalue +set current_value (cat $backlight_device) + +if test $action = up + echo (math $current_value + $dvalue) > $backlight_device +else if test $action = down + set newVal (math $current_value - $dvalue) + if test $newVal -lt 100 + set newVal 100 + end + echo New brightness value: $newVal + echo $newVal > $backlight_device +else + exit 2 +end + + +