bri

on kitten's pastes | raw

expires: 28 Jun, 2024

 1#!/bin/sh -x
 2
 3bn=28800
 4max_bn=96000
 5
 6# check if the argument is appending (modify $bn by this percentage)
 7case "$1" in
 8	[-+]*)
 9		z="$(( z=(bn + (max_bn * $1 / 100)), z > 0 ? z*1 : z*-1 ))"
10	;;
11	*)
12		# final brightness, percentage only
13		z="$(( max_bn * $1 / 100 ))"
14	;;
15esac