
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. /Allan -- Allan Wind Life Integrity, LLC http://lifeintegrity.com

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

How about assigning such function to manage hook, but the function
itself would check if all the required windows are present, and if it
hasn't acted before (so it would act only one time - after startup,
and after all manage hooks have run. During the last one, to be
precise).
Unfortunately I don't know so far how to express this in Haskell.
On 1/20/11, Brent Yorgey
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
_______________________________________________ xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad

On Fri, Jan 21, 2011 at 01:10:47PM +0300, kevind256 wrote:
How about assigning such function to manage hook, but the function itself would check if all the required windows are present, and if it hasn't acted before (so it would act only one time - after startup, and after all manage hooks have run. During the last one, to be precise).
Hmm, yes, this should be possible, but I think it would be a lot of work coding it up. I'd like to help but I'm not sure how to help in a way that wouldn't take a lot more time than I have. -Brent
On 1/20/11, Brent Yorgey
wrote: 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
_______________________________________________ xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad

DynamicHooks could probably help create a hook that only runs once.
(This hook could potentially reinstall itself if it finds out it is
not yet ready to run.)
http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Hooks-DynamicHooks.html
~d
Quoting Brent Yorgey
On Fri, Jan 21, 2011 at 01:10:47PM +0300, kevind256 wrote:
How about assigning such function to manage hook, but the function itself would check if all the required windows are present, and if it hasn't acted before (so it would act only one time - after startup, and after all manage hooks have run. During the last one, to be precise).
Hmm, yes, this should be possible, but I think it would be a lot of work coding it up. I'd like to help but I'm not sure how to help in a way that wouldn't take a lot more time than I have.
-Brent
On 1/20/11, Brent Yorgey
wrote: 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
_______________________________________________ xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad
_______________________________________________ xmonad mailing list xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 1/20/11 10:12 , Brent Yorgey wrote:
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
XMonad.Actions.SpawnOn, since both firefox/iceweasel and sufficiently recent xterm support _NET_WM_PID. Hack to make workspace 1 active: have the ManageHook invoked by spawnAndDo set a flag (see XMonad.Util.ExtensibleState), one for iceweasel and another for xterm, then check if both have been set and if so switch to workspace 1. Still not ideal if you have *other* windows starting up at the same time, though. Maybe X.U.Timer and switch to workspace 1 after a couple of seconds? - -- brandon s. allbery [linux,solaris,freebsd,perl] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk06XgkACgkQIn7hlCsL25XQcgCeOdKNduaJO8uLSsMgjqHiHVlw 488AnjN++8xZI5SBqXrZvJs6nfjHZ03P =evsQ -----END PGP SIGNATURE-----
participants (5)
-
Allan Wind
-
Brandon S Allbery KF8NH
-
Brent Yorgey
-
kevind256
-
wagnerdm@seas.upenn.edu