dotfiles/home/desktop/.local/bin/bright

24 lines
422 B
Bash
Executable File

#!/bin/sh
gpu1=/sys/class/backlight/amdgpu_bl1/brightness
gpu0=/sys/class/backlight/amdgpu_bl0/brightness
[ -f $gpu0 ] && file=$gpu0 || file=$gpu1
case $1 in
+) br="$(cat $file)"
br=$(($br + 10))
printf "$br" > $file
wayherb "Up Bright 10" &
;;
-)
br="$(cat $file)"
br=$(($br - 10))
printf "$br" > $file
wayherb "Down Bright 10" &
;;
-b)
wayherb "Brightness is set to : $(cat $file)" &
;;
esac