Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Adjust brightness from Terminal' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Adjust brightness from Terminal
Authored by: billearl on Sep 14, '09 12:21:02PM

For the uninitiated such as myself, PowerPC and 64Bit binaries, along with their installation location, would be useful. Thanks.



[ Reply to This | # ]
Adjust brightness from Terminal
Authored by: sabi on Sep 14, '09 01:07:05PM
I'm the original author of the code listed in this hint. I originally wrote it for two reasons: first, to adjust brightness automatically by location on my iBook G4, which had no ambient light sensor, and second, so I could have my laptop turn on the backlight when a long operation finished, providing a quiet form of notification I could use while at a seminar.

http://sabi.net/nriley/software/brightness.zip is 4-way universal, 10.5+. I compiled it under 10.6 with:


gcc-4.0 -arch i386 -arch x86_64 -arch ppc -arch ppc64 -isysroot /Developer/SDKs/MacOSX10.5.sdk \
-mmacosx-version-min=10.5 -std=c99 -o brightness \
-framework Cocoa -framework DisplayServices \
-F/Developer/SDKs/MacOSX10.5.sdk/System/Library/PrivateFrameworks brightness.m
(note that if you compile it with the 10.6 SDK you'll get a deprecation warning; it's harmless for now.)

[ Reply to This | # ]
Adjust brightness from Terminal
Authored by: billearl on Sep 15, '09 08:01:30PM

Thanks for this!

Just copied it to /usr/local/bin on my iBook G4 and it works great.



[ Reply to This | # ]
Adjust brightness from Terminal
Authored by: aGr[j5(6WU on Oct 01, '12 05:10:30PM
Does this work on Mountain Lion? I've just downloaded it, unzipped and run it and get the following:
dyld: Symbol not found: _OBJC_CLASS_$_O3Manager
  Referenced from: /Users/<username>/Downloads/brightness
  Expected in: /System/Library/PrivateFrameworks/DisplayServices.framework/Versions/A/DisplayServices
 in /Users/<username>/Downloads/brightness
Trace/BPT trap: 5
Mountain Lion 10.8.2 on a MacBook Pro

[ Reply to This | # ]
Adjust brightness from Terminal
Authored by: spencermefford on Jun 08, '13 11:03:58AM

You'll need to recompile it to work on Mountain Lion, but it's really easy. First, grab the source from http://dev.sabi.net/svn/dev/trunk/LocationDo/brightness.c and save it somewhere on your computer. Pop open terminal and run the following command from the same directory as brightness.c:

gcc -std=c99 -o brightness brightness.c -framework IOKit -framework ApplicationServices

You must have XCode installed to run this, and it worked like a charm for me. Move to /usr/local/bin and make sure it has the correct permissions. Hope this is helpful.



[ Reply to This | # ]
64-bit
Authored by: bankshot on Sep 16, '09 09:10:42AM

I guarantee that 64-bit won't gain you anything at all in this case over 32-bit running on Intel. This is such a small and simple application that there's no benefit whatsoever to going beyond 32-bit, even on a system running all 64-bit stuff otherwise. Well, maybe a tiny psychological advantage for those who absolutely can't stand to have their system "polluted" by 32-bit stuff, but certainly no real-world advantage. ;)

That said, many thanks to the original author and to the hint submitter for calling attention to it! This program gives me a great idea to simulate an intermittent screen problem in my custom anti-theft script for my MacBook. Can't wait to try it out.



[ Reply to This | # ]