Thanks for that! `workspace number #` is a nice syntax! Best regards! Fam Zheng
On Thu, Mar 21, 2013 at 8:37 PM, justus jonas <hap...@web.de> wrote: > Hi, > > Am 21.03.2013 13:27, schrieb Fam Zheng: > >> On Thu, Mar 21, 2013 at 6:31 PM, Axel Wagner <m...@merovius.de> wrote: >>> >>> Hi, >>> >>> Excerpts from Fam Zheng's message of 2013-03-21 04:16:32 +0100: >>>> >>>> Of course a bar option can be added too to enable/disable this >>>> feature. Or even give some sophisticated format option for the title, >>>> and also enable user to manually rename it. Would this feature be >>>> useful? >>>> >>>> To do this we need to add a few new events trigger and maybe a "title" >>>> field in get_workspace msg. I already have a demo modification for you >>>> to test how it feels, based on master. Now my life with many >>>> workspaces is much easier. :) >>> >>> >>> I think the only modification needed to i3 would be a focus-change-event >>> (and maybe with a little hack not even that) and what you want can be >>> entirely done with an ipc-script, no modifications to i3bar necessary. >>> >>> So I would do it like that: Have a daemon running that listens for focus >>> events, everytime such an event is triggered, get the current >>> workspaces, find out for each one, what window is currently focused >>> (maybe the focus event could include the „change“-data which would make >>> this step unnecessary) and change the title of that workspace to the >>> title of that window. >> >> >> >>> >>> As I said, I think it could also be possible with a little „hack“: By >>> using the workspace-event you could change the title everytime you >>> change away from a ws. Then you would have accurately titles for every >>> ws _not_ currently focused, which should be enough for getting an >>> overview. >>> >>> I think i3bar is definitely the wrong place to do what you want, though >>> it is a good idea. >>> Doing it in i3 (by including an option to change the ws-title to the >>> currently focused window) would be better, because then the feature >>> would be available to users of alternative ws-bars, if they exist. But >>> this would still be a lot of complexity added to i3 in C for something, >>> that can be done with IPC and a scripting-language. >>> Implementing the focus-change-event you should do in any case, imho, >>> because I ran over a few usecases which would profit from that in my >>> time. >> >> >> Event is the easiest part, just send an event at the end of `con_focus >> for window, as well as handle_destroy_notify_event, >> handle_windowname_change, would suffice. >> >> Renaming would be trickier, that would need a remap of key binding >> too, which sounds not so neat. IMO "name" of ws and "caption" or >> "title" of ws should be isolated, because mixing ws identifier and >> it's display is not a good idea, despite the complexity for the >> "ipc-script" to decompose and extract the original ws name, and query >> and parse the whole tree, and then remap all the keybindings to this >> workspace (would be a nightmare if many bindings refer to it) for each >> change. >> > > actually, you would not need to change your keybinding. you could use the > i3-command "workspace number <ws-id>" in your config file. Let's assume you > have workspaces "1: www" and "2: mail". Then configure your workspace > switchting keys to the following commands: > bindsym $mod+$1 workspace number 1: www > bindsym $mod+$2 workspace number 2: mail > > if you now rename the current workspace (e.g. 1: www) with "rename workspace > to '1: foo'", you can still access this workspace with your configured > keybinding. > > > >> The thing will be much easier if i3 adds a "caption" property to ws, >> so that i3bar and other bars can optionally render it to user, and >> this also benefits that renaming a workspace becomes more >> straightforward (no longer messing any keybinding). Maybe I'm too used >> to tmux. >> >> This is <100 LOC for both i3 and i3bar changes, if this feature is >> demanded, I can post my patch for review. >> >>> >>> >>> Regards, >>> >>> Axel > > > best > johannes >