#!/bin/sh

SYSTEM_BRIGHTNESS=/sys/class/backlight/backlight/brightness

# Check args
if [ ${#} -ne 1 ]; then
    echo "Usage: $(basename ${0}) new_brightness_percentage"
    exit 1
fi

# Check value's range
if [ ${1} -gt 100 ]; then
    echo "Usage: Wrong brightness percentage (${1}), must be between 0 and 100"
    exit 1
fi

# Set new brightness percentage
let value=${1}+10
let value/=10
echo ${value} > ${SYSTEM_BRIGHTNESS}
exit 0
