PDA

View Full Version : Simple shell script in Automator, big problem for me




petertje123
May 27, 2009, 08:11 AM
Hi, thanks for reading.

This is the problem;
For my Macbok AIr I need a script which alows me to excecute at startup these follwing lines: (I normaly have to add this manually in Terminal every time at startup)

/Applications/smcFanControl.app/Contents/Resources/smc -k F0Mx -w $(python -c 'print hex(3500 << 2)[2:]')

/Applications/smcFanControl.app/Contents/Resources/smc -k F0Mn -w $(python -c 'print hex(1500 << 2)[2:]')

This is because the fan of the Air is spinning like hell. This lowers the speed to an acceptable noise level.

Can someone explain me how to make this script. I understand that I can run an application in my User profile at startup.

thx!!
gr, from rainy Amsterdam



HiRez
May 27, 2009, 11:33 AM
In Automator, from the Library > Utilities section, drag a Run Shell Script object into your workflow, then paste that text into the text area inside it. If you want to run two commands like you have there, you'll probably have to either connect two of these objects, or paste both in the same window but replace the returns with a semicolon (see attached pic). Then save your script as an Application, and in System Preferences > Accounts > [your account] > Login Items, drag your script into the list. It should run whenever you log in.

lee1210
May 27, 2009, 11:42 AM
Now just don't do anything so intensive that the fan should be spinning faster than your upper-bound, slowly frying your hardware.

Also, why not hard-code the arguments there? You are going to, I would think, get the same value from python -c 'print hex(3500 << 2)[2:]' and python -c 'print hex(1500 << 2)[2:]' every time they run. Why not just use 36b0 and 1770 in your script?

-Lee

HiRez
May 27, 2009, 01:06 PM
Yeah, I should have mentioned that playing around with your fan speeds seems very dangerous, I hope you know what you are doing.

petertje123
May 28, 2009, 02:07 AM
Yeah, I should have mentioned that playing around with your fan speeds seems very dangerous, I hope you know what you are doing.

Thanks for your help. It already spins at 6200 round when opening my Air. So for that reason I really needed a solution.

What is the max temperature alowed for the Air CPU? 60/70/80degrees celcius??

xStep
May 28, 2009, 03:03 AM
Thanks for your help. It already spins at 6200 round when opening my Air. So for that reason I really needed a solution.

Sounds like a hardware problem. Take it in to be fixed. Or, try resetting the firmware first.