# Increasing run-time

**URL:** <https://forum.clockworkpi.com/t/increasing-run-time/11316>\
**Category:** uConsole\
**Created:** [October 18, 2023, 1:04pm UTC](https://forum.clockworkpi.com/t/increasing-run-time/11316 "2023-10-18T13:04:01Z")\
**Posts on this page:** 1\
**Showing post:** 23

<div class="post-metadata">

**Author:** ![Filia](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/filia/32/8707_2.png) [@Filia](https://forum.clockworkpi.com/u/Filia)\
**Post date:** [December 21, 2023, 6:10pm UTC](https://forum.clockworkpi.com/t/increasing-run-time/11316/23 "2023-12-21T18:10:02Z")

</div>

i did my own take on this, but made it in bash

```auto
#!/bin/bash

brightness=$(cat /sys/class/backlight/backlight@0/brightness)
maxBrightness=$(cat /sys/class/backlight/backlight@0/max_brightness)

if (( $1 > 0 ))
then
        if (($brightness+$1 < $maxBrightness))
        then
                echo $(($brightness+$1)) > /sys/class/backlight/backlight@0/brightness;
        else
                echo $maxBrightness > /sys/class/backlight/backlight@0/brightness
        fi;
else
        if (($brightness > 0))
        then
                if (($brightness-$2 > 0))
                then
                        echo $(($brightness-$2)) > /sys/class/backlight/backlight@0/brightness;
                else
                        echo 0 > /sys/class/backlight/backlight@0/brightness;
                fi;
        fi;
fi;

```

in my i3 config i use this to change my brightness

```auto
bindsym XF86MonBrightnessUp exec /home/$USER/scripts/backlight 2 0
bindsym XF86MonBrightnessDown exec /home/$USER/scripts/backlight 0 2

```

the first argument determines how much to increase brightness by. if its 0 then it will take the second argument as how much to decrease brightness by

---

_[View the full topic](https://forum.clockworkpi.com/t/increasing-run-time/11316)._
