Files
dotfiles/bin/brightness
2025-07-10 20:42:43 +02:00

25 lines
486 B
Fish
Executable File

#!/bin/fish
set backlight_device $argv[1]
set action $argv[2]
set dvalue $argv[3]
echo Backlight device: $backlight_device Bumping: $action By: $dvalue
set current_value (cat $backlight_device)
if test $action = up
echo (math $current_value + $dvalue) > $backlight_device
else if test $action = down
set newVal (math $current_value - $dvalue)
if test $newVal -lt 100
set newVal 100
end
echo New brightness value: $newVal
echo $newVal > $backlight_device
else
exit 2
end