Skip to content

Instantly share code, notes, and snippets.

@0xa
Created November 1, 2017 23:24
Show Gist options
  • Save 0xa/0da7b93431ca5f1a218cf9a256b333e6 to your computer and use it in GitHub Desktop.
Save 0xa/0da7b93431ca5f1a218cf9a256b333e6 to your computer and use it in GitHub Desktop.
#!/bin/sh
# changes the range of display brightness until it's merged into xfpm
# ---
# 1. save as /usr/bin/xfpm-power-backlight-helper
# 2. rename original to /usr/bin/xfpm-power-backlight-helper.orig
# 3. enjoy a hopefully more useful brightness setting
div=2
args=( "$@" )
if [ "${args[0]}" = "--set-brightness" ] && [ -n "${args[1]}" ]; then
args[1]=$((${args[1]} / $div))
fi
output=$(/usr/bin/xfpm-power-backlight-helper.orig ${args[@]})
if [ "${args[0]}" = "--get-brightness" ]; then
output=$(($output * $div))
fi
echo "$output"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment