[Xmonad] darcs patch: XSelection.hs: simplify creation of window (and 10 more)

Christian Thiemann mail at christian-thiemann.de
Tue Oct 23 17:07:24 EDT 2007

Gwern Branwen wrote:
> On 2007.10.23 14:50:35 +0200, Christian Thiemann <mail at christian-thiemann.de> scribbled 0 lines:
>> Gwern Branwen wrote:
>>> On 2007.10.23 11:29:34 +0300, "Valery V. Vorotyntsev"
>>> <valery.vv at gmail.com> scribbled 0 lines:
>>>> On 10/19/07, gwern0 at gmail.com <gwern0 at gmail.com> wrote:
>>>>> Fri Oct 19 14:09:00 EDT 2007  gwern0 at gmail.com
>>>>>   * Run.hs, ShellPrompt.sh: mv runInXTerm to ShellPrompt.hs
>>>> What is the purpose of this moving?
>>>> IMHO, the function fits nicely in Run.hs.
>>> IIRC, leaving runInXTerm in Run.hs causes a cyclical import - but I might
>>> have moved it because it made more sense to me in there.
>> The function was in a stand-alone module named RunInXTerm before the runXXX
>> functions were collected into Run.  So the situation for the function
>> itself is unchanged.  Probably the dependencies of the other
>> runXXX-functions cause some cyclical imports, but Run.hs just imports
>> XMonad from the core and nothing from the contrib, so I don't see where a
>> problem might arise, unless XMonad.hs imports some contrib modules, which
>> is not the case.
>> Conceptually I find it odd that I now need to import the whole ShellPrompt
>> facility just to get a command that has nothing to do with ShellPrompt.
>> Greetings,
>>   Christian
> Perhaps I don't understand your intent with runInXTerm then? My understanding was that it was supposed to take a string argument, pass it through the shell which would do whatever it specified, and then run the resultant command in an terminal specified by the shell (falling back to XTerm). This makes perfect sense to go into ShellPrompt to me - it's dealing with the shell, after all. Run.hs has various ways of running commands, ShellPrompt has various ways of running shell commands, and XSelection has various ways of dealing with the X selection.

ShellPrompt is providing a graphical prompt asking for a command to 
execute (not in a terminal - runInXTerm was introduced by Andrea in 
RunInXTerm.hs for import in SshPrompt.hs to bring up an ssh in a shell). 
  But you don't need the graphical ShellPrompt or the SshPrompt for 
running something in XTerm.  The probably more convincing examples are 
runProcessWithInput and runProcessWithInputAndWait: these were 
originally defined in Dmenu.hs and Dzen.hs - because they were handy 
functions to bring up a dmenu or dzen instance - and some other contribs 
then included Dmenu or Dzen just to get these functions, without using 
the dmenu or dzen related stuff.  That seemed odd to me.  Similarly, 
SshPrompt relies on being able to run something in a terminal (thus it 
should import some module that provides this functionality) but 
runInXTerm does not need the graphical SshPrompt (or ShellPrompt), thus 
I think one should not need to include ShellPrompt to be able to run 
something in a terminal.


Christian Thiemann
mail at christian-thiemann.de

More information about the Xmonad mailing list