Files
dotfiles/i3/.config/i3/bright.sh
2019-04-18 14:58:39 -04:00

16 lines
526 B
Bash
Executable File

#!/usr/bin/env bash
if [[ $1 == -d ]]; then
current=$(xrandr --verbose | grep -m 1 -i brightness | awk -F' ' '{ print $2 }')
new=$(echo "$current - 0.1" | bc -l)
xrandr --output eDP-1 --brightness 0$new
elif [[ $1 == -u ]]; then
current=$(xrandr --verbose | grep -m 1 -i brightness | awk -F' ' '{ print $2 }')
new=$(echo "$current + 0.1" | bc -l)
xrandr --output eDP-1 --brightness 0$new
elif [[ $1 == -m ]]; then
xrandr --output eDP-1 --brightness 1
else
xrandr --output eDP-1 --brightness $1
fi