After trawling here and there and trying lots of different things, for me this works on my late 2012 21″ iMac with an ACPI card. It’s best to put the script into a file, make sure the file is discoverable on PATH. All details are in the folder: /sys/class/backlight/acpi_video0 which on my machine looks like this: ubuntu@ubuntu:~/mc2$ cd /sys/class/backlight/acpi_video0 ubuntu@ubuntu:/sys/class/backlight/acpi_video0$ ls -l total 0 -r--r--r-- 1 root root 4096 Oct 7 08:29 actual_brightness -rw-r--r-- 1 root root 4096 Oct 7 08:29 bl_power -rw-r--r-- 1 root root 4096 Oct 7 08:28 brightness lrwxrwxrwx 1 root root 0 Oct 7 08:29 device -> ../../../0000:01:00.0 -r--r--r-- 1 root root 4096 Oct 7 08:03 max_brightness drwxr-xr-x 2 root root 0 Oct 7 08:29 power lrwxrwxrwx 1 root root 0 Oct 7 08:29 subsystem -> ../../../../../../class/backlight -r--r--r-- 1 root root 4096 Oct 7 08:03 type -rw-r--r-- 1 root root 4096 Oct 7 08:03 uevent WARNING: If you use values higher than the maximum...
To know one thing, you must know the opposite. -- Henry Moore