<br><div class="gmail_quote">On Fri, Feb 15, 2008 at 11:02 PM, Braden Shepherdson &lt;<a href="mailto:Braden.Shepherdson@gmail.com">Braden.Shepherdson@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">Don Stewart wrote:<br>
&gt; xmonad-bounces:<br>
&gt;&gt; The attached message has been automatically discarded.<br>
&gt;&gt; Date: Fri, 15 Feb 2008 08:45:01 +0200<br>
&gt;&gt; From: Salvatore Iovene &lt;<a href="mailto:salvatore.iovene@googlemail.com">salvatore.iovene@googlemail.com</a>&gt;<br>
&gt;&gt; To: <a href="mailto:xmonad@haskell.org">xmonad@haskell.org</a><br>
&gt;&gt; Subject: Emergency terminal<br>
&gt;&gt;<br>
&gt;&gt; Hi all,<br>
&gt;&gt; sometimes I need to open a terminal window just for a quick task (i.e.<br>
&gt;&gt; quickly view an image). Using Mod+p and opening a dmenu is not really<br>
&gt;&gt; good for that (lack of good completation support) and I don&#39;t want to<br>
&gt;&gt; open a new terminal that will change the existing layout (not good on<br>
&gt;&gt; the eye).<br>
&gt;&gt;<br>
&gt;&gt; The ideal solution would be having a special key that&#39;d fire up a<br>
&gt;&gt; floating terminal on the bottom of the screen, only, say, 5 lines<br>
&gt;&gt; high, so you could quickly give your command without interfering with<br>
&gt;&gt; the existing layout.<br>
&gt;&gt;<br>
&gt;&gt; Is there anything like this already around?<br>
&gt;&gt; Thanks!<br>
&gt;&gt;<br>
&gt;<br>
&gt; There&#39;s been much talk about a &#39;scratchpad&#39; terminal.<br>
&gt; This doesn&#39;t exist, but would be easy to implement as<br>
&gt; an extension -- just open up a terminal with a<br>
&gt; property set on it, then write a manageHook rule that<br>
&gt; looks for that property, and positions the window as floating,<br>
&gt; and with particular geometry.<br>
&gt;<br>
&gt; This would be a great extension to have, if someone<br>
&gt; would like to write it.<br>
&gt;<br>
&gt; -- Don<br>
<br>
<br>
</div></div>This will find its way onto the wiki and/or into Contrib eventually, but<br>
here&#39;s code and instructions for now.<br>
</blockquote><div><br>This is great!&nbsp; If you&#39;re up to it, please package this as a contrib module, probably in XMonad.Util.&nbsp; If you&#39;re not sure how to do that, or need any help just send an e-mail or ask in the #xmonad channel on <a href="http://irc.freenode.net">irc.freenode.net</a>.&nbsp; This should definitely go in the xmonad-contrib library as opposed to on the wiki. <br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Add the following manageHook entry:<br>
<br>
title &nbsp; &nbsp; =? &quot;scratchpad&quot; &nbsp; &nbsp; --&gt; doRectFloat scratchpadRect<br>
</blockquote><div><br>You could give this rule a name like &#39;manageScratchpad&#39; (maybe two versions, one with a default rectangle and one that takes the rectangle as a parameter) so users could just drop that into their manageHook.<br>
&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
and the following functions<br>
<br>
doRectFloat :: W.RationalRect -&gt; ManageHook<br>
doRectFloat r = ask &gt;&gt;= \w -&gt; doF (W.float w r)<br>
<br>
scratchpadRect :: W.RationalRect<br>
scratchpadRect = W.RationalRect 0.25 0.375 0.5 0.25<br>
</blockquote><div><br>doRectFloat should perhaps eventually go into ManageHook in the core, but for now I think it&#39;s fine to put it in a contrib module.<br>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
and the following keys entry:<br>
<br>
(( modMask, xK_s ), unsafeSpawn $ terminal conf ++ &quot; -title scratchpad&quot;)<br>
</blockquote><div><br>Again, you could define a function that performs this spawn and export it from the contrib module, so users can just drop it into their keybindings list with minimal effort.<br>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I&#39;m not sure how easily this could be bundled into a contrib package. It<br>
seems like it might be better just as an example minimal config for<br>
others to merge with their own.<br>
I&#39;m willing to package it up, but I don&#39;t have any experience sending<br>
darcs patches or uploading to hackage yet. </blockquote><div><br>No uploading to hackage necessary here! =)&nbsp; Just make sure you have the latest darcs sources (instructions for getting them are on <a href="http://xmonad.org">xmonad.org</a>; to get the latest patches just do a &#39;darcs pull&#39;).&nbsp; Once you&#39;ve made the changes you&#39;d like, do a &#39;darcs add&#39; to add any new files you created to the repository, then do &#39;darcs record&#39; to record your changes into a patch.&nbsp; Finally, &#39;darcs send&#39; will send your patch to the mailing list (if you have a mail agent configured correctly to do this; otherwise you can just do &#39;darcs send -o /path/to/some/file.dpatch&#39; and then manually attach the generated file to a message to the list.&nbsp; Again, if you need any help, don&#39;t hesitate to ask!<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> as are critiques of my code (it seems like my<br>
doRectFloat should exist in contrib already somewhere, this can&#39;t be the<br>
first time someone&#39;s wanted that feature).<br>
<font color="#888888"></font></blockquote><div><br>The code looks great.&nbsp; And you&#39;d be surprised how many obvious, simple, yet really nice features there are that no one&#39;s thought of or wanted yet. =)<br><br>-Brent<br>
</div></div><br>