dotfiles/.config/eww/scripts/set-brightness.sh

11 lines
316 B
Bash
Executable file

#!/bin/bash
if [[ "$1" =~ ^[0-9]+$ ]]; then
echo "$1" > /sys/class/backlight/amdgpu_bl1/brightness
elif [[ "$1" == "raise" ]]; then
swayosd-client --brightness raise
elif [[ "$1" == "lower" ]]; then
swayosd-client --brightness lower
fi
eww update brightness=$(cat /sys/class/backlight/amdgpu_bl1/brightness)