<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>hmmm.... &#187; screen</title>
	<atom:link href="http://michael.thegrebs.com/tag/screen/feed/" rel="self" type="application/rss+xml" />
	<link>http://michael.thegrebs.com</link>
	<description></description>
	<lastBuildDate>Thu, 27 Oct 2011 18:48:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>screen copy mode can be used to copy/paste</title>
		<link>http://michael.thegrebs.com/2008/07/10/screen-copy-mode-can-copy/</link>
		<comments>http://michael.thegrebs.com/2008/07/10/screen-copy-mode-can-copy/#comments</comments>
		<pubDate>Thu, 10 Jul 2008 16:38:48 +0000</pubDate>
		<dc:creator>mikegrb</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[screen]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://michael.thegrebs.com/?p=124</guid>
		<description><![CDATA[I&#8217;m aware of many people that use GNU Screen&#8217;s copy mode to scroll back through terminal history but don&#8217;t actually use copy mode for copying text for later pasting. I was one of those people myself for some time. Screen &#8230; <a href="http://michael.thegrebs.com/2008/07/10/screen-copy-mode-can-copy/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m aware of many people that use GNU Screen&#8217;s copy mode to scroll back through terminal history but don&#8217;t actually use copy mode for copying text for later pasting.  I was one of those people myself for some time.  Screen supports some pretty nifty copy/paste tricks but a few basic key strokes will get you started.</p>
<p><strong>Entering Copy Mode and Scrolling</strong></p>
<p>By default, enter copy mode with</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">CTRL+a</div></div>
<p>then</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ESCAPE</div></div>
<p>.  You can use vi like commands to navigate through the scollback buffer.  The arrows and</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">PAGE UP/DOWN</div></div>
<p>should work as well.  A few useful commands some may be unfamiliar with:</p>
<ul>
<li>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">M</div></div>
<p>- jumps to the middle visible line</li>
<li>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">NN%</div></div>
<p>- jumps to the specified percentage in the buffer (0 &#8211; start, 100 &#8211; end</li>
<li>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">g</div></div>
<p>- jumps to the beginning of the buffer</li>
<li>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">G</div></div>
<p>- jumps to the end of the buffer</li>
</ul>
<p>These keys are even useful when you aren&#8217;t using copy mode to copy/paste text.</p>
<p><strong>Copying Text</strong></p>
<p>Once the cursor is at the beginning location, press</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">SPACEBAR</div></div>
<p>to set your first mark.  Next navigate to the ending position and hit it again.  The second</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">SPACEBAR</div></div>
<p>will set your end mark and exit copy mode.  One neat and often useful feature is selecting a rectangle on the screen rather than full lines.  Use</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">c</div></div>
<p>and</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">C</div></div>
<p>to set the left and right column margins to the cursor&#8217;s current location.</p>
<p><strong>Pasting</strong></p>
<p>Pasting is easy, just hit</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">CTRL+a</div></div>
<p>to activate screen then</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">]</div></div>
<p>to paste.</p>
<p><strong>There&#8217;s More!</strong></p>
<p>There are loads more options such as multiple copy buffers, the ability to append marked text to the buffer rather than replacing it, etc.  Check out the man page for more screen goodness.</p>
]]></content:encoded>
			<wfw:commentRss>http://michael.thegrebs.com/2008/07/10/screen-copy-mode-can-copy/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Rotate through Screen Windows</title>
		<link>http://michael.thegrebs.com/2008/06/26/rotate-through-screen-windows/</link>
		<comments>http://michael.thegrebs.com/2008/06/26/rotate-through-screen-windows/#comments</comments>
		<pubDate>Thu, 26 Jun 2008 17:18:01 +0000</pubDate>
		<dc:creator>mikegrb</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[screen]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://michael.thegrebs.com/?p=122</guid>
		<description><![CDATA[A new command in screen version 4.00 is the idle command. idle time command Executes screen command, command when idle for time seconds. E.g. to rotate through screen windows with a 3 second interval: idle 3 next To cancel, idle &#8230; <a href="http://michael.thegrebs.com/2008/06/26/rotate-through-screen-windows/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A new command in screen version 4.00 is the</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">idle</div></div>
<p>command.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">idle time command</div></div>
<p>Executes screen command,</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">command</div></div>
<p>when idle for</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">time</div></div>
<p>seconds. E.g. to rotate through screen windows with a 3 second interval:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">idle 3 next</div></div>
<p>To cancel,</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">idle 0</div></div>
]]></content:encoded>
			<wfw:commentRss>http://michael.thegrebs.com/2008/06/26/rotate-through-screen-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weather in Screen Statusbar</title>
		<link>http://michael.thegrebs.com/2008/06/05/weather-in-screen-statusbar/</link>
		<comments>http://michael.thegrebs.com/2008/06/05/weather-in-screen-statusbar/#comments</comments>
		<pubDate>Fri, 06 Jun 2008 03:06:14 +0000</pubDate>
		<dc:creator>mikegrb</dc:creator>
				<category><![CDATA[geek]]></category>
		<category><![CDATA[screen]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://michael.thegrebs.com/?p=117</guid>
		<description><![CDATA[Caspar Clemens Mierau recently wrote about a nifty Debian package named weather-util and his method for embedding the current temperature into the screen status bar. Quite nifty. I did the same with one small exception, including the predicted probability of &#8230; <a href="http://michael.thegrebs.com/2008/06/05/weather-in-screen-statusbar/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://michael.thegrebs.com/wp-content/uploads/2008/06/screen-weather.png" alt="" title="Weather in Screen" width="279" height="49" class="alignright size-full wp-image-120" /><br />
Caspar Clemens Mierau <a href="http://www.screenage.de/blog/2008/06/04/my-package-of-the-day-weather-util-weather-report-and-forecast-for-the-console/">recently wrote</a> about a nifty Debian package named <tt>weather-util</tt> and his method for embedding the current temperature into the screen status bar.  Quite nifty.  I did the same with one small exception, including the predicted probability of precipitation if it exists.</p>
<p>My one liner that runs from cron (split to multiple lines for readability):</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;weather -iKACY -f | head -n 9 &nbsp;| \<br />
&nbsp; &nbsp; &nbsp;awk '/Temperature/ { print $2 &quot;F&quot; } <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /Relative/ { print $3 } <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /precipitation/ { sub (/ chance of.+$/, &quot;&quot;); print &quot;POP &quot; $NF }' | \<br />
&nbsp; &nbsp; &nbsp;xargs echo &gt; /home/michael/.weather</div></div>
<p>More details on the full implementation in the original post over at <a href="http://www.screenage.de/blog/2008/06/04/my-package-of-the-day-weather-util-weather-report-and-forecast-for-the-console/">Caspar Clemens Mierau&#8217;s blog</a>.  And yes, I stole his loadavg stuff too ;)</p>
<p><strong>UPDATE:</strong></p>
<p>Silly me, upon further investigation, two things to note.  First, the -i option applies only to current conditions and not to the forecast.  In my case I actually want <tt>weather -f ACY</tt> and <tt>/etc/weatherrc</tt> takes care of the rest.  Secondly, the field number for the precipitation percentage changes, oops.  I&#8217;ve correctly accounted for this in the updated awk script above.</p>
<p>After making these changes I decided the awk script was getting a bit long for a single line so I went all out creating <tt>~/bin/weather.awk</tt>:</p>
<div class="codecolorer-container awk vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="awk codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color:#808080;">#!/usr/bin/awk -f</span><br />
<br />
<span style="color:black;">/</span>Temperature<span style="color:black;">/</span> &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#123;</span> temp = <span style="color:#000088;">$2</span> <span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<span style="color:black;">/</span>Relative Humidity<span style="color:black;">/</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span> rh = <span style="color:#000088;">$3</span> &nbsp; <span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<span style="color:black;">/</span>precipitation<span style="color:black;">/</span> &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#123;</span> <span style="color: #07D589; font-weight: bold;">sub</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color:black;">/</span> chance of.<span style="color:black;">+</span>$<span style="color:black;">/</span>, <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; precip = <span style="color:#000088;">$NF</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
<span style="color: #C20CB9; font-weight: bold;">END</span><span style="color: #7a0874; font-weight: bold;">&#123;</span> <span style="color: #0BD507; font-weight: bold;">print</span> temp <span style="color: #ff0000;">&quot;F &quot;</span> rh <span style="color: #ff0000;">&quot; POP &quot;</span> precip <span style="color: #7a0874; font-weight: bold;">&#125;</span></div></div>
<p>My crontab entry now looks like:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">*/5 * * * * &nbsp; &nbsp; weather -f ACY | /home/michael/bin/weather.awk &gt; /home/michael/.weather</div></div>
<p>Much simpler.</p>
]]></content:encoded>
			<wfw:commentRss>http://michael.thegrebs.com/2008/06/05/weather-in-screen-statusbar/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

