Linux Mint LMDE, Xfce, Toshiba R700, suspend-resume and backlight keys

I've put Linux Mint Debian Edition on my Toshiba R700 laptop and I'm using the Xfce window manager. Initially everything seemed to work fine, but after a suspend-resume cycle the brightness keys no longer worked (Fn-F6 and Fn-F7) although everything else did. A fruitless search for a solution across the intertubes then ensued. It appears that the original problem was caused because somebody decided they'd rip support for a feature they wanted to deprecate out of the Toshiba ACPI driver more-or-less "to see what broke" - nice. Well, the answer is "lots of things" if the number of reports of this problem that I've found are any indication.

I found a lot of suggested workarounds and without going into the gory details, none of them actually worked and in fact they generally made things worse, for example making the backlight not come on at all after resume. I did get a few clues as to how to work around the problem by diddling the backlight driver files under /sys/class/backlight, specifically the ones in the intel_backlight subdirectory. The problem is that you can only write to those files if you are root, so I've knocked up a small C program that can be made setuid-root and used to change the backlight level. I've put this in /usr/local/bin and used the Keyboard settings manager to map the <Super>F7 and <Super>F6 keys to calls to "backlight -u" and "backlight -d" to adjust the brightness up and down. This works both before and after suspend-resume and I've set it up to have 16 different brightness levels as I find the standard 8 a bit too wide apart. In case it helps someone else I've put the source here and a precompiled 64-bit binary here - if you need the 32-bit version you'll have to build from source. Enjoy!

Re: Linux Mint LMDE, Xfce, Toshiba R700, suspend-resume and backlight keys

Saved my sanity, plus the 8-step is much nicer!  Thank you