<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: Make my Mac beep me when it's finished.</title>
	<link>http://ask.metafilter.com/37983/Make-my-Mac-beep-me-when-its-finished/</link>
	<description>Comments on Ask MetaFilter post Make my Mac beep me when it's finished.</description>
	<pubDate>Thu, 11 May 2006 04:56:49 -0800</pubDate>
	<lastBuildDate>Thu, 11 May 2006 04:56:49 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: Make my Mac beep me when it&apos;s finished.</title>
		<link>http://ask.metafilter.com/37983/Make-my-Mac-beep-me-when-its-finished</link>	
		<description>Help me make my other Mac, in the other room, beep me when an app has finished what it&apos;s doing. &lt;br /&gt;&lt;br /&gt; I have two Macs. The one in the living room is for browsing. The other one, down the hall, is where I do things like burning DVDs. It&apos;s not online.&lt;br&gt;
&lt;br&gt;
So, if burning a DVD takes 20 minutes or so, I forget about it. A couple of hours later I remember and start burning the next one. So about an hour&apos;s work can take all day. And I can&apos;t be forever walking down the hall to see how it&apos;s going.&lt;br&gt;
&lt;br&gt;
So, there must be some way I can run a script which monitors &lt;strong&gt;ps&lt;/strong&gt; or &lt;strong&gt;top&lt;/strong&gt; or something, right? &lt;br&gt;
&lt;br&gt;
Every minute it could check and if Disk Utility&apos;s CPU usage was at 0.00%, then it&apos;s finished. And the computer would start quietly beeping. There&apos;s still some BELL character you can print to make it beep, right? Am I going to have problems with false positives, readings of zero for a split second?&lt;br&gt;
&lt;br&gt;
For all I know there&apos;s actually shiny-GUI software which will do this, but I&apos;ve never heard of it and can&apos;t think how to search. And I don&apos;t need it. I&apos;ll happily start the app, then type &lt;br&gt;
&lt;br&gt;
&lt;pre&gt;beepwhenfinished &apos;Disk Utility&apos;&lt;/pre&gt; &lt;br&gt;
&lt;br&gt;
or something.</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2006:site.37983</guid>
		<pubDate>Thu, 11 May 2006 03:59:27 -0800</pubDate>
		<dc:creator>AmbroseChapel</dc:creator>
		
			<category>apple</category>
		
			<category>mac</category>
		
			<category>shellscript</category>
		
			<category>perl</category>
		
			<category>top</category>
		
			<category>ps</category>
		
			<category>monitor</category>
		
			<category>beep</category>
		
	</item> <item>
		<title>By: bonaldi</title>
		<link>http://ask.metafilter.com/37983/Make-my-Mac-beep-me-when-its-finished#587816</link>	
		<description>I wrote a script like this to monitor when an application has died and restart it. If you don&apos;t find a more robust solution here, I&apos;ll hack it up to do what you want. Email in profile.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.37983-587816</guid>
		<pubDate>Thu, 11 May 2006 04:56:49 -0800</pubDate>
		<dc:creator>bonaldi</dc:creator>
	</item><item>
		<title>By: kimota</title>
		<link>http://ask.metafilter.com/37983/Make-my-Mac-beep-me-when-its-finished#587817</link>	
		<description>I don&apos;t know if &lt;a href=&quot;http://growl.info/&quot;&gt;Growl&lt;/a&gt; does or could be made to do specifically what you mention, but it&apos;s in the right ballpark!</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.37983-587817</guid>
		<pubDate>Thu, 11 May 2006 05:02:36 -0800</pubDate>
		<dc:creator>kimota</dc:creator>
	</item><item>
		<title>By: eriko</title>
		<link>http://ask.metafilter.com/37983/Make-my-Mac-beep-me-when-its-finished#587818</link>	
		<description>Hmm.&lt;br&gt;
&lt;br&gt;
Maybe (this isn&apos;t tried on MacOS yet....)&lt;br&gt;
&lt;br&gt;
From the shell (this is /bin/sh, not (ickbleagh) csh. IIRC, tiger uses bash as the default shell, that&apos;ll work as well.&lt;br&gt;
&lt;br&gt;
FOO=1; while [  $FOO != &quot;0.0&quot; ] do $FOO=`ps -axo %cpu=c -o command=n | grep &apos;Disk Utility&quot; | cut -b 1-4`; sleep 1; done; while true do echo &quot;^G^G^G^G^G&quot;; sleep 1; done&lt;br&gt;
&lt;br&gt;
(The ^G above is &quot;Control-G&quot;. Control-G is ASCII BEL, it rings the bell. This should beep.)&lt;br&gt;
&lt;br&gt;
Note that the test I&apos;m using here is not a mathmatical test, it&apos;s a string comparision. Why? Because I&apos;m not sure if the OS/X shell&apos;s test will cope with non-integers correctly.&lt;br&gt;
&lt;br&gt;
Issue: Does ps work the same way as mine? Probably, given Jordan Hubbard is working at Apple, so many of the command line utilites speak FreeBSD.&lt;br&gt;
&lt;br&gt;
Ideally, the right way to do this is to find a burning utility that works from the command line. When I get to the office and open up the notebook, I&apos;ll check for burncd or if Disk Utility has any command line features.&lt;br&gt;
&lt;br&gt;
I&apos;ll also note that this is a oneliner, not a production script.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.37983-587818</guid>
		<pubDate>Thu, 11 May 2006 05:04:14 -0800</pubDate>
		<dc:creator>eriko</dc:creator>
	</item><item>
		<title>By: pmbuko</title>
		<link>http://ask.metafilter.com/37983/Make-my-Mac-beep-me-when-its-finished#587823</link>	
		<description>DVD burning is pretty predictable as to how long it&apos;s going to take -- it&apos;s more or less directly proportional to the amount of data (duh, right?). How about starting the burn, looking at the estimated time remaining, add a minute or two, and then setting up a kitchen timer?&lt;br&gt;
&lt;br&gt;
Yeah, it&apos;s low tech and doesn&apos;t carry over to other tasks of inteterminate duration, but it&apos;ll sure work DVD burning.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.37983-587823</guid>
		<pubDate>Thu, 11 May 2006 05:31:19 -0800</pubDate>
		<dc:creator>pmbuko</dc:creator>
	</item><item>
		<title>By: Wolfdog</title>
		<link>http://ask.metafilter.com/37983/Make-my-Mac-beep-me-when-its-finished#587827</link>	
		<description>If you can arrange for the app to actually quit when it finishes burning (seems like it might be an option), you do something like this:&lt;br&gt;
&lt;br&gt;
&lt;tt&gt;while (killall -s [name of burning app] &amp;gt;/dev/null) do sleep 10; done; echo ^G&lt;/tt&gt;&lt;br&gt;
&lt;br&gt;
killall recognizes processes by name, has nonzero exit status if the program isn&apos;t actually running.  The echo will make a single &apos;bonk&apos; sound at you so you might replace that with something noisier.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.37983-587827</guid>
		<pubDate>Thu, 11 May 2006 05:35:46 -0800</pubDate>
		<dc:creator>Wolfdog</dc:creator>
	</item><item>
		<title>By: AmbroseChapel</title>
		<link>http://ask.metafilter.com/37983/Make-my-Mac-beep-me-when-its-finished#587838</link>	
		<description>Radical solution, &lt;strong&gt;pmbuko&lt;/strong&gt;. I don&apos;t even &lt;em&gt;have&lt;/em&gt; a kitchen timer! Good point though.&lt;br&gt;
&lt;br&gt;
I don&apos;t have Tiger either by the way (still on Panther, should have said), and prefer tcsh, but anyway, yes, that looks good &lt;strong&gt;eriko&lt;/strong&gt;. I&apos;ll try it ... hmm.&lt;br&gt;
&lt;br&gt;
It&apos;s not working for me in in bash or sh.&lt;br&gt;
&lt;br&gt;
I get &lt;pre&gt;syntax error near unexpected token `done&apos;&lt;/pre&gt;Also, I think we&apos;ve got mixed single and double quotes around Disk Utility?</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.37983-587838</guid>
		<pubDate>Thu, 11 May 2006 05:49:53 -0800</pubDate>
		<dc:creator>AmbroseChapel</dc:creator>
	</item><item>
		<title>By: AmbroseChapel</title>
		<link>http://ask.metafilter.com/37983/Make-my-Mac-beep-me-when-its-finished#587842</link>	
		<description>Thanks &lt;strong&gt;Wolfdog&lt;/strong&gt; but no, it can&apos;t quit when finished. Good idea otherwise.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.37983-587842</guid>
		<pubDate>Thu, 11 May 2006 05:52:23 -0800</pubDate>
		<dc:creator>AmbroseChapel</dc:creator>
	</item><item>
		<title>By: Mr. Six</title>
		<link>http://ask.metafilter.com/37983/Make-my-Mac-beep-me-when-its-finished#587847</link>	
		<description>Wolfdog&apos;s answer, as well as a similar script written in AppleScript instead of csh, will eat 10-20% of the CPU in monitoring and parsing processes. If your application of interest fires off distributed notifications as its status changes, it is possible to write a threaded app that will listen for those notifications in an efficient way.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.37983-587847</guid>
		<pubDate>Thu, 11 May 2006 05:59:49 -0800</pubDate>
		<dc:creator>Mr. Six</dc:creator>
	</item><item>
		<title>By: AmbroseChapel</title>
		<link>http://ask.metafilter.com/37983/Make-my-Mac-beep-me-when-its-finished#587848</link>	
		<description>By the way &lt;pre&gt;ps -axo %cpu=c -o command=n&lt;/pre&gt; seems to be doing what you expect, i.e. a list of running processes with cpu usage numbers before them.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.37983-587848</guid>
		<pubDate>Thu, 11 May 2006 05:59:55 -0800</pubDate>
		<dc:creator>AmbroseChapel</dc:creator>
	</item><item>
		<title>By: Wolfdog</title>
		<link>http://ask.metafilter.com/37983/Make-my-Mac-beep-me-when-its-finished#587858</link>	
		<description>&lt;small&gt;&lt;i&gt;will eat 10-20% of the CPU&lt;/i&gt;&lt;br&gt;
Um, no.  Try it.  Monitor it.&lt;/small&gt;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.37983-587858</guid>
		<pubDate>Thu, 11 May 2006 06:11:13 -0800</pubDate>
		<dc:creator>Wolfdog</dc:creator>
	</item><item>
		<title>By: primer_dimer</title>
		<link>http://ask.metafilter.com/37983/Make-my-Mac-beep-me-when-its-finished#587991</link>	
		<description>How about something as simple as &lt;br&gt;
&lt;br&gt;
&lt;code&gt;burn_dvd_command_line &amp;amp;&amp;amp; echo ^G&lt;/code&gt;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.37983-587991</guid>
		<pubDate>Thu, 11 May 2006 08:39:23 -0800</pubDate>
		<dc:creator>primer_dimer</dc:creator>
	</item><item>
		<title>By: Prince Nez</title>
		<link>http://ask.metafilter.com/37983/Make-my-Mac-beep-me-when-its-finished#588004</link>	
		<description>To take eriko&apos;s ball and run with it,&lt;br&gt;
&lt;code&gt;&lt;br&gt;
#!/bin/sh&lt;br&gt;
cpu=1&lt;br&gt;
while [ $cpu -gt 0 ]; do&lt;br&gt;
   cpu=`ps -axo %cpu=c -o command=n | grep &quot;[/]$1 &quot; | cut -d&apos;.&apos; -f1`&lt;br&gt;
   sleep 60&lt;br&gt;
done&lt;br&gt;
while true; do&lt;br&gt;
   say beep # or perhaps say &quot;$1&quot; is finished&lt;br&gt;
   sleep 10&lt;br&gt;
done&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
Save that as &lt;code&gt;beepwhenfinished&lt;/code&gt; and give it the ol&apos;&lt;br&gt;
&lt;br&gt;
&lt;code&gt;chmod +x beepwhenfinished&lt;/code&gt;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.37983-588004</guid>
		<pubDate>Thu, 11 May 2006 08:47:10 -0800</pubDate>
		<dc:creator>Prince Nez</dc:creator>
	</item><item>
		<title>By: cyrusdogstar</title>
		<link>http://ask.metafilter.com/37983/Make-my-Mac-beep-me-when-its-finished#588014</link>	
		<description>Not the best solution, but I use a &lt;small&gt;&lt;small&gt;perfectly legal&lt;/small&gt;&lt;/small&gt; copy of Toast Titanium to burn stuff, and it has plenty of &quot;I&apos;m done! LOL&quot; audible alerts. I use it for exactly what you&apos;re looking for.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.37983-588014</guid>
		<pubDate>Thu, 11 May 2006 08:59:54 -0800</pubDate>
		<dc:creator>cyrusdogstar</dc:creator>
	</item><item>
		<title>By: nicwolff</title>
		<link>http://ask.metafilter.com/37983/Make-my-Mac-beep-me-when-its-finished#588060</link>	
		<description>This is the kind of thing Perl&apos;s good at, so:&lt;br&gt;
&lt;br&gt;
&lt;code&gt;perl -e &apos;sleep 1 while `ps -axo %cpu -o command | grep &quot;[/]Disk Utility&quot;` !~ / 0.0 /; print &quot;^G^G^G^G&quot;&apos;&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
To type the ^G character at the command line, type ctrl-v ctrl-g.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.37983-588060</guid>
		<pubDate>Thu, 11 May 2006 10:12:31 -0800</pubDate>
		<dc:creator>nicwolff</dc:creator>
	</item><item>
		<title>By: nicwolff</title>
		<link>http://ask.metafilter.com/37983/Make-my-Mac-beep-me-when-its-finished#588063</link>	
		<description>&lt;small&gt;Oh and thanks to eriko for the ps formatting flags and Prince Nez for the nifty [/] grep trick - how did I not know that?!&lt;/small&gt;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.37983-588063</guid>
		<pubDate>Thu, 11 May 2006 10:16:19 -0800</pubDate>
		<dc:creator>nicwolff</dc:creator>
	</item><item>
		<title>By: AmbroseChapel</title>
		<link>http://ask.metafilter.com/37983/Make-my-Mac-beep-me-when-its-finished#588410</link>	
		<description>Thanks for all the suggestions like the command-line burner and the use of an application which beeps.&lt;br&gt;
&lt;br&gt;
I should make a couple of things clearer I guess -- it&apos;s not just DVD burning. As I said, it&apos;s &quot;things like DVD burning&quot;. So I really was looking for a generalised solution which I could use on any application which ran long processes.&lt;br&gt;
&lt;br&gt;
The solution posted by &lt;strong&gt;Prince Nez&lt;/strong&gt; seems to be working, although it&apos;s complaining &lt;pre&gt;line 3: [: -gt: unary operator expected&lt;/pre&gt;&lt;br&gt;
Just to be clear, I&apos;m typing &lt;pre&gt;./bwf &amp;lt;name of app&amp;gt;&lt;/pre&gt; as in &lt;pre&gt;./bwf VLC.app&lt;/pre&gt; while VLC plays a video, and when the video&apos;s done, the mac says &quot;beep&quot; over and over.&lt;br&gt;
&lt;br&gt;
I saved it as &quot;bwf&quot; because it just seems more Unix-y...</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.37983-588410</guid>
		<pubDate>Thu, 11 May 2006 13:50:12 -0800</pubDate>
		<dc:creator>AmbroseChapel</dc:creator>
	</item><item>
		<title>By: AmbroseChapel</title>
		<link>http://ask.metafilter.com/37983/Make-my-Mac-beep-me-when-its-finished#588464</link>	
		<description>&lt;strong&gt;nicwolf&lt;/strong&gt;, your solution successfully monitored the process but I didn&apos;t get any sound. I&apos;m not sure the ^G thing works on OS X?</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.37983-588464</guid>
		<pubDate>Thu, 11 May 2006 14:15:10 -0800</pubDate>
		<dc:creator>AmbroseChapel</dc:creator>
	</item><item>
		<title>By: AmbroseChapel</title>
		<link>http://ask.metafilter.com/37983/Make-my-Mac-beep-me-when-its-finished#588579</link>	
		<description>I researched &lt;a href=&quot;http://growl.info/&quot;&gt;Growl&lt;/a&gt; by the way and while it&apos;s a brilliant idea, it&apos;s not supported by any of the apps I&apos;ve got in mind.&lt;br&gt;
&lt;br&gt;
The combination of Growl and &lt;a href=&quot;http://www.macs.hw.ac.uk/~rpointon/osx/op.html&quot;&gt;Observation Post&lt;/a&gt; might somehow do it, and if it was just burning I needed the notifications for I could use the Growl-aware &lt;a href=&quot;http://www.radicalbreeze.com/blaze/&quot;&gt;DiskBlaze&lt;/a&gt;, but I&apos;m happy with the shell script myself.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.37983-588579</guid>
		<pubDate>Thu, 11 May 2006 16:28:24 -0800</pubDate>
		<dc:creator>AmbroseChapel</dc:creator>
	</item><item>
		<title>By: Prince Nez</title>
		<link>http://ask.metafilter.com/37983/Make-my-Mac-beep-me-when-its-finished#588674</link>	
		<description>&lt;blockquote&gt;&lt;br&gt;
The solution posted by Prince Nez seems to be working, although it&apos;s complaining&lt;br&gt;
&lt;code&gt;line 3: [: -gt: unary operator expected&lt;/code&gt;&lt;br&gt;
&lt;/blockquote&gt;&lt;br&gt;
&lt;br&gt;
That&apos;ll happen if the &lt;code&gt;$cpu&lt;/code&gt; variable is empty, which is anytime the &lt;code&gt;grep&lt;/code&gt; comes up with nothing. Make sure you get the name of the app right, and quote any apps with spaces in their names&lt;br&gt;
&lt;br&gt;
&lt;code&gt;bwf iTunes&lt;br&gt;
bwf &apos;Disk Utility&apos;&lt;/code&gt;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.37983-588674</guid>
		<pubDate>Thu, 11 May 2006 19:36:03 -0800</pubDate>
		<dc:creator>Prince Nez</dc:creator>
	</item><item>
		<title>By: AmbroseChapel</title>
		<link>http://ask.metafilter.com/37983/Make-my-Mac-beep-me-when-its-finished#590598</link>	
		<description>Catching up on this...&lt;br&gt;
&lt;br&gt;
Hmm, I definitely am quoting where I need to quote. I was anticipating that in the OP!&lt;br&gt;
&lt;br&gt;
That error message only occurs after the app has finished, once, not every time it checks.&lt;br&gt;
&lt;br&gt;
I&apos;ve learned in using it that Disk Utility can have periods of Zero CPU use which give false positives, for instance when a CD has been burnt, then gets mounted, then verified, usage is briefly zero during the mounting stage.&lt;br&gt;
&lt;br&gt;
But I think I know enough now to run a double-check and see if $cpu has been zero twice in two minutes, that should be enough to iron out that bug.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.37983-590598</guid>
		<pubDate>Sun, 14 May 2006 17:22:47 -0800</pubDate>
		<dc:creator>AmbroseChapel</dc:creator>
	</item>
	</channel>
</rss>
