<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Random Color Terminal</title>
	<atom:link href="http://www.red-sweater.com/blog/220/random-color-terminal/feed" rel="self" type="application/rss+xml" />
	<link>http://www.red-sweater.com/blog/220/random-color-terminal</link>
	<description>Mac &#38; Technology Writings by Daniel Jalkut</description>
	<lastBuildDate>Wed, 18 Jan 2012 18:10:04 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
	<item>
		<title>By: David</title>
		<link>http://www.red-sweater.com/blog/220/random-color-terminal/comment-page-1#comment-120022</link>
		<dc:creator>David</dc:creator>
		<pubDate>Sat, 23 Jun 2007 15:03:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/220/random-color-terminal#comment-120022</guid>
		<description>I just found that simply adding
osascript /PATH/TO/RandomColorTerminal.scpt
to your .profile is a bad idea. If you run any bash scripts, you will find that your terminal colour will suddenly change. Currently, my work-around is to check the current shell level in my .profile before calling the script:
if [ $SHLVL -eq 1 ]; then
    osascript /PATH/TO/RandomColorTerminal.scpt
fi


However, there are still problems. If I create two terminals fast enough (Cmd-N, Cmd-N), then I get one regular colour Terminal and one who&#039;s colour changes twice. Does anyone have a fix that only changes the invoking Terminal (pass in some kind of ID, like $PPID or so)?</description>
		<content:encoded><![CDATA[<p>I just found that simply adding<br />
osascript /PATH/TO/RandomColorTerminal.scpt<br />
to your .profile is a bad idea. If you run any bash scripts, you will find that your terminal colour will suddenly change. Currently, my work-around is to check the current shell level in my .profile before calling the script:<br />
if [ $SHLVL -eq 1 ]; then<br />
    osascript /PATH/TO/RandomColorTerminal.scpt<br />
fi</p>
<p>However, there are still problems. If I create two terminals fast enough (Cmd-N, Cmd-N), then I get one regular colour Terminal and one who&#8217;s colour changes twice. Does anyone have a fix that only changes the invoking Terminal (pass in some kind of ID, like $PPID or so)?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.red-sweater.com/blog/220/random-color-terminal/comment-page-1#comment-120008</link>
		<dc:creator>David</dc:creator>
		<pubDate>Sat, 23 Jun 2007 14:08:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/220/random-color-terminal#comment-120008</guid>
		<description>Thanks! This is just what I was looking for.

One problem: I don&#039;t like bright background colours. I wanted different dark colours so I could tell terminal windows apart.

So I changed your script to only give me dark background colours. After your global declaration:
-- Use a different maximum to keep our background dark
global kDarkColorValueMaximum
set kDarkColorValueMaximum to 20000 -- a good max for dark colours

And I changed the set randomRed/Blue/Green to use my constant:
set randomRed to (random number) * kDarkColorValueMaximum


And then I added it to my .profile. Now each terminal window is different.</description>
		<content:encoded><![CDATA[<p>Thanks! This is just what I was looking for.</p>
<p>One problem: I don&#8217;t like bright background colours. I wanted different dark colours so I could tell terminal windows apart.</p>
<p>So I changed your script to only give me dark background colours. After your global declaration:<br />
&#8211; Use a different maximum to keep our background dark<br />
global kDarkColorValueMaximum<br />
set kDarkColorValueMaximum to 20000 &#8212; a good max for dark colours</p>
<p>And I changed the set randomRed/Blue/Green to use my constant:<br />
set randomRed to (random number) * kDarkColorValueMaximum</p>
<p>And then I added it to my .profile. Now each terminal window is different.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon</title>
		<link>http://www.red-sweater.com/blog/220/random-color-terminal/comment-page-1#comment-23299</link>
		<dc:creator>Jon</dc:creator>
		<pubDate>Tue, 07 Nov 2006 16:15:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/220/random-color-terminal#comment-23299</guid>
		<description>mick - ahhh, Visor was causing my problems too.  I use way too many terminal windows for Visor to be helpful anyway, so no big loss.</description>
		<content:encoded><![CDATA[<p>mick &#8211; ahhh, Visor was causing my problems too.  I use way too many terminal windows for Visor to be helpful anyway, so no big loss.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Jalkut</title>
		<link>http://www.red-sweater.com/blog/220/random-color-terminal/comment-page-1#comment-22777</link>
		<dc:creator>Daniel Jalkut</dc:creator>
		<pubDate>Mon, 06 Nov 2006 04:28:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/220/random-color-terminal#comment-22777</guid>
		<description>HI Nathan - great minds think alike. I actually have a similar script available on my free AppleScripts page:

http://www.red-sweater.com/AppleScript/

&quot;Terminal at Selection&quot; ... I couldn&#039;t live without it. I also added some logic that will go ahead and chose the path of the folder that&#039;s selected, if there is one. So you can for instance type-select a folder and hit the keyboard shortcut to jump there.</description>
		<content:encoded><![CDATA[<p>HI Nathan &#8211; great minds think alike. I actually have a similar script available on my free AppleScripts page:</p>
<p><a href="http://www.red-sweater.com/AppleScript/" rel="nofollow">http://www.red-sweater.com/AppleScript/</a></p>
<p>&#8220;Terminal at Selection&#8221; &#8230; I couldn&#8217;t live without it. I also added some logic that will go ahead and chose the path of the folder that&#8217;s selected, if there is one. So you can for instance type-select a folder and hit the keyboard shortcut to jump there.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nathan</title>
		<link>http://www.red-sweater.com/blog/220/random-color-terminal/comment-page-1#comment-22772</link>
		<dc:creator>Nathan</dc:creator>
		<pubDate>Mon, 06 Nov 2006 04:20:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/220/random-color-terminal#comment-22772</guid>
		<description>How about a AppleScript to go to the folder to the top window in finder

tell application &quot;Terminal&quot;
	try
		tell application &quot;Finder&quot; to set theFolder to target of window 1 as alias
		if (count of every window) is 0 then
			do script &quot;cd &#039;&quot; &amp; POSIX path of theFolder &amp; &quot;&#039;&quot;
		else
			if not busy of window 1 then
				do script &quot;cd &#039;&quot; &amp; POSIX path of theFolder &amp; &quot;&#039;&quot; in window 1
			else
				do script &quot;cd &#039;&quot; &amp; POSIX path of theFolder &amp; &quot;&#039;&quot;
			end if
		end if
	end try
end tell</description>
		<content:encoded><![CDATA[<p>How about a AppleScript to go to the folder to the top window in finder</p>
<p>tell application &#8220;Terminal&#8221;<br />
	try<br />
		tell application &#8220;Finder&#8221; to set theFolder to target of window 1 as alias<br />
		if (count of every window) is 0 then<br />
			do script &#8220;cd &#8216;&#8221; &amp; POSIX path of theFolder &amp; &#8220;&#8216;&#8221;<br />
		else<br />
			if not busy of window 1 then<br />
				do script &#8220;cd &#8216;&#8221; &amp; POSIX path of theFolder &amp; &#8220;&#8216;&#8221; in window 1<br />
			else<br />
				do script &#8220;cd &#8216;&#8221; &amp; POSIX path of theFolder &amp; &#8220;&#8216;&#8221;<br />
			end if<br />
		end if<br />
	end try<br />
end tell</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mick</title>
		<link>http://www.red-sweater.com/blog/220/random-color-terminal/comment-page-1#comment-22179</link>
		<dc:creator>mick</dc:creator>
		<pubDate>Fri, 03 Nov 2006 22:14:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/220/random-color-terminal#comment-22179</guid>
		<description>&lt;a href=&quot;http://docs.blacktree.com/visor/visor&quot; rel=&quot;nofollow&quot;&gt;Visor&lt;/a&gt; was breaking the script somehow.  After I disabled it, the script works.</description>
		<content:encoded><![CDATA[<p><a href="http://docs.blacktree.com/visor/visor" rel="nofollow">Visor</a> was breaking the script somehow.  After I disabled it, the script works.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Jalkut</title>
		<link>http://www.red-sweater.com/blog/220/random-color-terminal/comment-page-1#comment-22165</link>
		<dc:creator>Daniel Jalkut</dc:creator>
		<pubDate>Fri, 03 Nov 2006 21:33:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/220/random-color-terminal#comment-22165</guid>
		<description>Weird - it works on my PowerPC G5 and my MacBook Pro Core Duo.</description>
		<content:encoded><![CDATA[<p>Weird &#8211; it works on my PowerPC G5 and my MacBook Pro Core Duo.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mick</title>
		<link>http://www.red-sweater.com/blog/220/random-color-terminal/comment-page-1#comment-22152</link>
		<dc:creator>mick</dc:creator>
		<pubDate>Fri, 03 Nov 2006 20:29:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/220/random-color-terminal#comment-22152</guid>
		<description>It doesn&#039;t work for me either.  10.4.8 on a Intel iMac.  Script Editor doesn&#039;t give any errors.</description>
		<content:encoded><![CDATA[<p>It doesn&#8217;t work for me either.  10.4.8 on a Intel iMac.  Script Editor doesn&#8217;t give any errors.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Jalkut</title>
		<link>http://www.red-sweater.com/blog/220/random-color-terminal/comment-page-1#comment-22120</link>
		<dc:creator>Daniel Jalkut</dc:creator>
		<pubDate>Fri, 03 Nov 2006 16:14:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/220/random-color-terminal#comment-22120</guid>
		<description>Jon: I suppose it&#039;s worth asking what version of OS X you&#039;re running. And when you run the script from Script Editor, does it fail with any kind of error, or just silently not do anything?</description>
		<content:encoded><![CDATA[<p>Jon: I suppose it&#8217;s worth asking what version of OS X you&#8217;re running. And when you run the script from Script Editor, does it fail with any kind of error, or just silently not do anything?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon</title>
		<link>http://www.red-sweater.com/blog/220/random-color-terminal/comment-page-1#comment-22118</link>
		<dc:creator>Jon</dc:creator>
		<pubDate>Fri, 03 Nov 2006 16:10:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/220/random-color-terminal#comment-22118</guid>
		<description>So am I the only one this doesn&#039;t work for, then?  I run the script, and Terminal just stays with my default white-on-black color scheme.  :(</description>
		<content:encoded><![CDATA[<p>So am I the only one this doesn&#8217;t work for, then?  I run the script, and Terminal just stays with my default white-on-black color scheme.  :(</p>
]]></content:encoded>
	</item>
</channel>
</rss>

