This commit is contained in:
Le-foucheur authored and GitHub committed 2024-09-14 19:16:24 +02:00
1 parent dbdbd377fb
commit 84ab8eb2ad
10 files changed
+118

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
#!/bin/sh
#augmente la luminosité de arg%, 10% si non spécifié
#retourne le % de luminosité en fin de commande
max=$(cat /sys/class/backlight/apple-panel-bl/subsystem/apple-panel-bl/max_brightness)
if [ -n "$1" ]
then
dim=$1
else
dim=10
fi
next=$(expr $(cat /sys/class/backlight/apple-panel-bl/subsystem/apple-panel-bl/brightness) - $max '*' "$dim" '/' 100)
if [ -z "$next" ]
then
exit 1
fi
if [ $next -lt 0 ]
then
next=0
fi
echo $next > /sys/class/backlight/apple-panel-bl/subsystem/apple-panel-bl/brightness
echo $(expr $next "*" 100 "/" $max)