
Hi, There are a couple ideas I would like to discuss. 1) Fixed number of workspaces is too inflexible and somewhat ugly, IMO. What about creating workspaces by demand, instead? The same way `ion' does to workspaces or screen to its "windows". 2) When xmonad quits, it forgets layout settings -- number of windows in master pane, current tiling algorithm, focused window, master/subordinate ratio, etc. Doesn't it? We could save this information to `~/.xmonad' file and read it at next startup. And a question. 3) Can I define a key binding like, say, `Win-k 1'? The pattern is `<modifiers>-<key1> <key2>'. I find such screen/ion/emacs-y keystrokes very handy. :) Thank you. And happy hacking! -- vvv

On Tue, Oct 16, 2007 at 04:22:17PM +0300, Valery V. Vorotyntsev wrote:
1) Fixed number of workspaces is too inflexible and somewhat ugly, IMO.
What about creating workspaces by demand, instead? The same way `ion' does to workspaces or screen to its "windows".
IMHO you can get very close already, and probably to the point where you have all the behavious you want. (Unless there's something you want I can't think of.) What I mean is: for a given compilation of xmonad, yes, there is indeed an upper bound on the number of workspaces available. However, at compile time you can set that upper bound to be anything you want (so it is in some sense unbounded), and at runtime you can easily only care about the ones with contents. I'm not sure what else "creating workspaces by demand" would give you on top of that. For arbitrarily-sized workspace pools at compile-time, modify Config.hs: -- 99 workspaces workspaces = map show [1 .. 99 :: Int] -- 999 workspaces workspaces = map show [1 .. 999 :: Int] etc. (I admit I haven't tried this, but it's clear it's possible. Of course, it makes moving to a particular workspace more interesting (keybindings, etc.), but you'll have that problem anyway with arbitrarily created workspaces.) When I say "you can easily only care about the ones with contents" I mean: using the dynamicLog and RotView contrib modules, I see and move about in a list of the workspaces with things in them, which grows if I send something to a new workspace, and shrinks if I empty a workspace - so I have the appearance of a constantly growing and shrinking set of workspaces. Their names happen to be in the range 0-9 but that range could be made bigger. In practice I never need more than 9, but the possibility is there. It really is a lot like having them created/disposed of on demand, and works quite seamlessly for me at least. It's definitely the closest thing to virtual desktop perfection I've yet experienced. (I believe there's also a way to assign names to workspaces, though I haven't felt the need to try it out. That might be one possible advantageous side-effect of on-demand workspaces, but OTOH, thinking of my wmii days, having to think of names for workspaces would probably slow me down. ;-) ) Just some random possibly-useful thoughts... Cheers! -Andy -- Andy Gimblett Computer Science Department University of Wales Swansea http://www.cs.swan.ac.uk/~csandy/

On 10/16/07, Andy Gimblett
On Tue, Oct 16, 2007 at 04:22:17PM +0300, Valery V. Vorotyntsev wrote:
1) Fixed number of workspaces is too inflexible and somewhat ugly, IMO.
What about creating workspaces by demand, instead? The same way `ion' does to workspaces or screen to its "windows".
[...]
When I say "you can easily only care about the ones with contents" I mean: using the dynamicLog and RotView contrib modules, I see and move about in a list of the workspaces with things in them, which grows if I send something to a new workspace, and shrinks if I empty a workspace - so I have the appearance of a constantly growing and shrinking set of workspaces. Their names happen to be in the range 0-9 but that range could be made bigger. In practice I never need more than 9, but the possibility is there. It really is a lot like having them created/disposed of on demand, and works quite seamlessly for me at least. It's definitely the closest thing to virtual desktop perfection I've yet experienced.
Oh, thank you. I'll try these modules. And I have a strong suspicion the desired functionality is already there. :)
(I believe there's also a way to assign names to workspaces, though I haven't felt the need to try it out. That might be one possible advantageous side-effect of on-demand workspaces, but OTOH, thinking of my wmii days, having to think of names for workspaces would probably slow me down. ;-) )
I don't have such an experience. Ordinal number (up to 4)) are good enough for me. Thanks again! -- vvv

On Oct 16, 2007, at 9:22 , Valery V. Vorotyntsev wrote:
2) When xmonad quits, it forgets layout settings -- number of windows in master pane, current tiling algorithm, focused window, master/subordinate ratio, etc. Doesn't it?
We could save this information to `~/.xmonad' file and read it at next startup.
This is kinda tricky if the windows in question don't exist at startup, no? The correct way to handle it is to support session manager integration: on exit, save the serialized layout in the session manager as a -layout option; the session manager will then restart xmonad with the specified options, at the same time that it restores the other programs in the session so that all the windows in the layout are (hopefully) also recreated. But then xmonad needs to know to hold on to it until it at least has the windows explicitly mentioned... and, does -layout work by windowid, or by class/name/ role? windowid is a nonstarter across X11 server instances/ instantiations.
3) Can I define a key binding like, say, `Win-k 1'?
See XMonadContrib/SubMap.hs. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

On 10/16/07, Brandon S. Allbery KF8NH
On Oct 16, 2007, at 9:22 , Valery V. Vorotyntsev wrote:
2) When xmonad quits, it forgets layout settings -- number of windows in master pane, current tiling algorithm, focused window, master/subordinate ratio, etc. Doesn't it?
We could save this information to `~/.xmonad' file and read it at next startup.
This is kinda tricky if the windows in question don't exist at startup, no?
But xmonad already remembers m/s ratio while running, even when all of its clients are killed. And new clients are created with the "customized" proportions. Which even differ for `tiled' and `Mirror tiled' modes! (The number of clients per master pane is also remembered.) But the next time I enter my X session, the ratio is 1:2. :) All runtime customizations are gone. This is not the case with ion3.
The correct way to handle it is to support session manager integration: on exit, save the serialized layout in the session manager as a -layout option; the session manager will then restart xmonad with the specified options, at the same time that it restores the other programs in the session so that all the windows in the layout are (hopefully) also recreated. But then xmonad needs to know to hold on to it until it at least has the windows explicitly mentioned... and, does -layout work by windowid, or by class/name/ role? windowid is a nonstarter across X11 server instances/ instantiations.
Could you tell me, where to read about this `-layout' option? Does it relate to gdm? And I don't actually care about where my xterm goes at startup. I just hate my daily routine of tuning emacs 80 characters wide. :)
3) Can I define a key binding like, say, `Win-k 1'?
See XMonadContrib/SubMap.hs.
Thanks a lot. -- vvv

On Oct 16, 2007, at 10:41 , Valery V. Vorotyntsev wrote:
Could you tell me, where to read about this `-layout' option? Does it relate to gdm?
No, it's an xmonad option. Look at how xmonad preserves layout state across restarts (mod-q). Session managers expect X11 clients to register command lines with them specifying how to restart them with their current state; xmonad already implements this, it should be easy for xmonad to register a WM_COMMAND property for the use of any session manager that is running (handling WM_SAVE_YOURSELF may be a little trickier). -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH

On 2007-10-16 17:41:38 Valery V. Vorotyntsev wrote:
On 10/16/07, Brandon S. Allbery KF8NH
wrote: On Oct 16, 2007, at 9:22 , Valery V. Vorotyntsev wrote:
2) When xmonad quits, it forgets layout settings -- number of windows in master pane, current tiling algorithm, focused window, master/subordinate ratio, etc. Doesn't it?
We could save this information to `~/.xmonad' file and read it at next startup.
This is kinda tricky if the windows in question don't exist at startup, no?
But xmonad already remembers m/s ratio while running, even when all of its clients are killed. And new clients are created with the "customized" proportions. Which even differ for `tiled' and `Mirror tiled' modes! (The number of clients per master pane is also remembered.)
But the next time I enter my X session, the ratio is 1:2. :) All runtime customizations are gone. This is not the case with ion3.
You can set this stuff in Config.hs. Not as easy as just having your runtime changes saved, but also not so easy to mess up. /J

On 10/16/07, Jamie Webb
You can set this stuff in Config.hs. Not as easy as just having your runtime changes saved, but also not so easy to mess up.
Right. I'll do that. (I feel so stupid by missing the obvious solution.) -- vvv

On Tue, Oct 16, 2007 at 04:22:17PM +0300, Valery V. Vorotyntsev wrote:
Hi,
There are a couple ideas I would like to discuss.
1) Fixed number of workspaces is too inflexible and somewhat ugly, IMO.
What about creating workspaces by demand, instead? The same way `ion' does to workspaces or screen to its "windows".
I agree. You could try the DynamicWorkspaces module in contrib (which I wrote), which allows you to add and remove workspaces. I've been meaning (one day) to write an XPrompt extension that allows you to either select an existing (named) workspace or create a new one (by typing in a new name), but haven't gotten around to it. I really liked that feature of ion3, which allows me to easily keep track of workspaces (and add and remove them just as easily). As someone else pointed out, you could also approximate the dynamic workspace with RotView (which I also wrote) but it's a bit ugly, in my opinion. -- David Roundy Department of Physics Oregon State University

On 10/16/07, David Roundy
I agree. You could try the DynamicWorkspaces module in contrib (which I wrote), which allows you to add and remove workspaces. I've been meaning (one day) to write an XPrompt extension that allows you to either select an existing (named) workspace or create a new one (by typing in a new name), but haven't gotten around to it. I really liked that feature of ion3, which allows me to easily keep track of workspaces (and add and remove them just as easily).
As someone else pointed out, you could also approximate the dynamic workspace with RotView (which I also wrote) but it's a bit ugly, in my opinion.
Another module I should try. :) Thank you, guys! -- vvv

On Tue, Oct 16, 2007 at 04:22:17PM +0300, Valery V. Vorotyntsev wrote:
2) When xmonad quits, it forgets layout settings -- number of windows in master pane, current tiling algorithm, focused window, master/subordinate ratio, etc. Doesn't it?
We could save this information to `~/.xmonad' file and read it at next startup.
This is most definitely implementable, and not hard. We already know how to save the workspace settings, and it wouldn't be hard to remove the windows to do so cleanly. It'd almost have to be in core, though, which means that there needs to be closer to universal agreement. Actually, with a bit of scripting, it could actually be done right now as a contrib module, provided you were willing to make your script that starts xmonad read the file, and pass its contents as an argument after --resume. -- David Roundy Department of Physics Oregon State University

valery.vv:
Hi,
There are a couple ideas I would like to discuss.
1) Fixed number of workspaces is too inflexible and somewhat ugly, IMO.
What about creating workspaces by demand, instead? The same way `ion' does to workspaces or screen to its "windows".
As pointed out, workspaces are created on demand (they're represented with Nothing when empty), all you need to do is set the upper bound so we can bind keys. -- Don
participants (6)
-
Andy Gimblett
-
Brandon S. Allbery KF8NH
-
David Roundy
-
Don Stewart
-
Jamie Webb
-
Valery V. Vorotyntsev