<br><div class="gmail_quote">On Fri, Feb 15, 2008 at 11:02 PM, Braden Shepherdson <<a href="mailto:Braden.Shepherdson@gmail.com">Braden.Shepherdson@gmail.com</a>> 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>
> xmonad-bounces:<br>
>> The attached message has been automatically discarded.<br>
>> Date: Fri, 15 Feb 2008 08:45:01 +0200<br>
>> From: Salvatore Iovene <<a href="mailto:salvatore.iovene@googlemail.com">salvatore.iovene@googlemail.com</a>><br>
>> To: <a href="mailto:xmonad@haskell.org">xmonad@haskell.org</a><br>
>> Subject: Emergency terminal<br>
>><br>
>> Hi all,<br>
>> sometimes I need to open a terminal window just for a quick task (i.e.<br>
>> quickly view an image). Using Mod+p and opening a dmenu is not really<br>
>> good for that (lack of good completation support) and I don't want to<br>
>> open a new terminal that will change the existing layout (not good on<br>
>> the eye).<br>
>><br>
>> The ideal solution would be having a special key that'd fire up a<br>
>> floating terminal on the bottom of the screen, only, say, 5 lines<br>
>> high, so you could quickly give your command without interfering with<br>
>> the existing layout.<br>
>><br>
>> Is there anything like this already around?<br>
>> Thanks!<br>
>><br>
><br>
> There's been much talk about a 'scratchpad' terminal.<br>
> This doesn't exist, but would be easy to implement as<br>
> an extension -- just open up a terminal with a<br>
> property set on it, then write a manageHook rule that<br>
> looks for that property, and positions the window as floating,<br>
> and with particular geometry.<br>
><br>
> This would be a great extension to have, if someone<br>
> would like to write it.<br>
><br>
> -- Don<br>
<br>
<br>
</div></div>This will find its way onto the wiki and/or into Contrib eventually, but<br>
here's code and instructions for now.<br>
</blockquote><div><br>This is great! If you're up to it, please package this as a contrib module, probably in XMonad.Util. If you'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>. 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 =? "scratchpad" --> doRectFloat scratchpadRect<br>
</blockquote><div><br>You could give this rule a name like 'manageScratchpad' (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>
</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 -> ManageHook<br>
doRectFloat r = ask >>= \w -> 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's fine to put it in a contrib module.<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>
and the following keys entry:<br>
<br>
(( modMask, xK_s ), unsafeSpawn $ terminal conf ++ " -title scratchpad")<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> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I'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'm willing to package it up, but I don't have any experience sending<br>
darcs patches or uploading to hackage yet. </blockquote><div><br>No uploading to hackage necessary here! =) 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 'darcs pull'). Once you've made the changes you'd like, do a 'darcs add' to add any new files you created to the repository, then do 'darcs record' to record your changes into a patch. Finally, 'darcs send' will send your patch to the mailing list (if you have a mail agent configured correctly to do this; otherwise you can just do 'darcs send -o /path/to/some/file.dpatch' and then manually attach the generated file to a message to the list. Again, if you need any help, don'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't be the<br>
first time someone's wanted that feature).<br>
<font color="#888888"></font></blockquote><div><br>The code looks great. And you'd be surprised how many obvious, simple, yet really nice features there are that no one's thought of or wanted yet. =)<br><br>-Brent<br>
</div></div><br>