From 1a919d62992bf1cb5d6431d51ed1c4c8a295c76a Mon Sep 17 00:00:00 2001
From: steel99xl <steel99xl@gmail.com>
Date: Sun, 18 Feb 2024 22:11:43 -0500
Subject: [PATCH] Dependancyfree

Now without brightnessctl dependancy
---
 AutomaticBrightness.sh | 30 +++++++++++++++++++++---------
 README.md              |  5 ++++-
 2 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/AutomaticBrightness.sh b/AutomaticBrightness.sh
index 5056a71..e39adb6 100755
--- a/AutomaticBrightness.sh
+++ b/AutomaticBrightness.sh
@@ -146,17 +146,29 @@ do
 			  NewLight=$(( $DiffCount ))
 
 
+
+              CurrentBrightness=$(cat $BLightPath)
+              FakeLight=$(( $NewLight + $CurrentBrightness))
+
+              if [[ $FakeLight -gt $MaxScreenBrightness ]]
+              then
+                  NewLight=$MaxScreenBrightness
+                  echo "ERROR"
+              else
+                  echo $FakeLight > $BLightPath
+              fi
+
         # Format values apropriatly for brightnessctl
-			  if [[ $NewLight -lt 0 ]]
-			  then
-			  NewLight=$( echo "$NewLight" | awk -F "-" {'print$2'})
-			  NewLight=$(echo $NewLight-)
-			  else
-			  NewLight=$(echo +$NewLight)
-			  fi
-        
+			  #if [[ $NewLight -lt 0 ]]
+			  #then
+			  #NewLight=$( echo "$NewLight" | awk -F "-" {'print$2'})
+			  #NewLight=$(echo $NewLight-)
+			  #else
+			  #NewLight=$(echo +$NewLight)
+			  #fi
+
         # Adjust brightness relativly
-			  brightnessctl -q s $NewLight
+			  #brightnessctl -q s $NewLight
         # Sleep for the screen Hz time so he effect is visible
 			  sleep $AnimationDelay
 
diff --git a/README.md b/README.md
index 478b5c8..bbba596 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,10 @@ based on 2017 MacBook Pro
 read ```Configuration``` for detailed informatoion about what options you have to easily  customize/ adjust the bightness or animation speed
 
 ## Requires 
-brightnessctl
+For running in as your user you need to be part of the ```vidoe``` group 
+```sudo usermod -a -G vido $USER``` if your not apart of the group
+
+If your installing as a system service your user dose not need to be apart of the group
 
 ## Non 12th Gen Intel Framework Owners
 Your sensor has a diffrent range thant the 12th Gen Intel Framework laptop sensors, please see chart bellow