I am trying to set up my system and to get some practice with scripting and the like. I am running Linux Mint 16 on a Samsung RC520 laptop (
Linux 3.11.0-12-generic x86_64). I want to implement a script that will lower my screen brightness to a pre-set value when I unplug the power (and raise it when I plug it back in).
I can do some very basic scripting but not near this level. I have "xbacklight" which will set the brightness from the command line, so when I unplug the power the line I want to implement would be
xbacklight -set 20. I also know that unplugging the power is registered by acpi ; when I plug out and then back in the power I get the following with
$ acpi_listen ac_adapter ADP1 00000080 00000000 processor CPU0 00000081 00000000 processor CPU1 00000081 00000000 processor CPU2 00000081 00000000 processor CPU3 00000081 00000000 ac_adapter ADP1 00000080 00000001 processor CPU0 00000081 00000000 processor CPU1 00000081 00000000 processor CPU2 00000081 00000000 processor CPU3 00000081 00000000 battery BAT1 00000080 00000001
So I know I have to use this but I have two main problems:
I wouldn't know where to put the script so that it is automatically implemented, and I don't know how I would recognise the plug in/out in acpi because all I know how to do is