aboutsummaryrefslogblamecommitdiff
path: root/.config/swayrbar/scripts/brightness-status
blob: 562ee62f0422a39c7a6baa5fd114d39ddde6aed9 (plain) (tree)






















                                                                         
#!/usr/bin/env sh

brightness_path=/sys/class/backlight/*/brightness
brightness_max_path=/sys/class/backlight/*/max_brightness

if [ -f "${brightness_path}" ]
then
	brightness="$(cat $brightness_path)"
fi

if [ -f "${brightness_max_path}" ]
then
	brightness_max="$(cat /sys/class/backlight/*/max_brightness)"
fi

if [ -n "${brightness}" ] && [ -n "${brightness_max}" ]
then
	level=$(echo "scale=2; $brightness / $brightness_max * 100" | bc)

	printf "  "
	printf "%.0f\n" $level
fi
a684da33669eff984bd8b98f554a2&follow=1'>dwm(bar): silence errors a bitLuca Matei Pintilie1-16/+36 2024-07-11sway: use hyprlock, swaysome, swayr and swaybarLuca Matei Pintilie1-51/+59 2024-07-11swaylock: set background imageLuca Matei Pintilie1-2/+5 2024-07-11hyprlock: add configLuca Matei Pintilie2-0/+132 2024-07-11swayrbar: add configLuca Matei Pintilie6-0/+252