[xmonad] Initial Layout

Brent Yorgey byorgey at seas.upenn.edu
Thu Jan 20 16:12:15 CET 2011


On Wed, Jan 19, 2011 at 01:02:22PM -0500, Allan Wind wrote:
> I am starting xterm, iceweasel (aka firefox) and pidgin from .xsession:
> 
> iceweasel &
> pidgin &
> uxterm -e 'tmux new mutt' &
> exec /usr/bin/x-window-manager
> 
> And using the following xmonad configuration:
> 
> myManageHook = composeAll [
>         className =? "Gimp" --> doFloat,
>         className =? "Iceweasel" --> doF (W.shift "1"),
>         (className =? "Iceweasel" <&&> resource =? "Dialog") --> doFloat,
>         className =? "Pidgin" <&&> title =? "Buddy List" --> doShift "2"
>         ]
> 
> main = xmonad $ ewmh defaultConfig {
>         borderWidth = 1,
>         manageHook = myManageHook <+> manageHook defaultConfig,
>         modMask = mod4Mask,
>         terminal = "/usr/bin/x-terminal-emulator -e tmux"
>         }
> 
> This gives me the following behavior:
> 
> xterm on workspace 1 right
> iceweasel on workspace 1 left
> pidgin on workspace 2
> 
> active desktop is 2.  Two questions (a) Is there a way to swap xterm and
> iceweasel for the initial session?  (b) And how do I tell xmoand that workspace
> 1 should be active?  I am happy to dig more into the docs.

Honestly I am not sure there is a good way to do this.  One problem is
that the manage hooks are not guaranteed to run in any particular
order; another problem is there's no good way that I know of to run
some action *after* all the manage hooks have run.  You can define a
startupHook in your configuration to be run when xmonad starts, but
that runs *before* the manage hooks so it won't help you.  The only
way I can think to do it would be to make a keybinding which will
arrange the windows for you and take you to to workspace 1, which
should be possible with a little StackSet munging.

-Brent



More information about the xmonad mailing list