[NTLUG:Discuss] More shell scripting madness

Daniel Hauck daniel at yacg.com
Thu Jul 5 15:59:14 CDT 2007


That's great code.  I was almost to that point when Cox came in and 
wrecked the creative effort with simplicity and elegance. :)

But I was about %50 of where you were by the time I read Cox's idea and 
went with his suggestion.  I have added to that by using "zenity 
--notification" code in the main loop.  So when it's running, there will 
be an icon in the systray and when it stops, it goes away!  Very nice. 
(if I wanted to, I could even animate the systray icon by setting up a 
rotation of icons to display with each cycle of the while loop... but 
nah... I know I could do it, but ... well maybe I will at some point.)


Richard Geoffrion さんは書きました:
> . Daniel wrote:
>> I know it's hard to see, but I'm actually starting to learn this stuff 
>> little by little.
>>
>>   
> I understand COMPLETLY
>> Here's the purpose:
>>
>> I upgraded the processor and video in my laptop.  Now it gets warmer than I 
>> like,
> Some have suggested using CPUFREQ instead of i8kfan, but I realize that
> you are wanting maximum cpu speed with maximum cooling. I'll leave you
> to figure out the "y" of how to do something.
> 
>> So I wrote a loop that checks the fan status every two seconds and if it's 
>> not "2 2" it will set the fans to "2 2" and go back to sleep.  
>>
>> <snip for politeness>
>>
>> Here's what I'd like to add to it. 
>>
>> <more snippage.
>>   
> 
> While a better more elegant solution most probably exists (Chris Cox
> :->) The attached script should match the criteria for doing what you
> asked. I think it's all there in educationally commented steps. It's not
> a one liner..but something that can be used as a learning tool. I know
> *I* learned some stuff. :)
> 
> Oh, and if you want to see the file without the comments, you can run:
> 
> sed '/^[[:space:]]*#/d;/^$/d <irc://irc.freenode.net/%23/d%3b/%5e%24/d>'
> fanscript.txt
> 
> (unless you're irc nick is greycat, in which case the above command is
> bad evil bad and doesn't work!)
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> http://www.ntlug.org/mailman/listinfo/discuss




More information about the Discuss mailing list