martanne / dvtm

dvtm brings the concept of tiling window management, popularized by X11-window managers like dwm to the console. As a console window manager it tries to make it easy to work with multiple console based programs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

attachaside patch

faradayawerty opened this issue · comments

If only there was a patch similar to dwm's attachaside.
I prefer the new window not to become a new master but to be created as a slave.

Would you like some pointers on how to do it? It's been a while since I checked dvtm source code, so it would be a nice exercise for me, and you would get a chance to get your hands dirty with it as well 😃

Actually, I solved it by adding these lines at the end of create function:
zoom(NULL);
focus(c);
Feels like a bit of a workaround though...

Feels like a bit of a workaround though...

It is, and despite the fact that it works it's kind of hard to see what it is doing. Still, it's good that you managed to solve it your own way.

A couple more pointers if you want to explore a bit more:

  • The first function you want to look at is attach. In create it is used to put the new Client in the doubly linked list of clients (as the first element). It should be possible to write a function attachlast to attach something to the end of the list (or maybe keep track of the last element of the list, along with clients, which is a reference to the first).
  • The function attachafter seems interesting as well. For example, in a classic tiled layout I would prefer the new client to be attached "at the top" of the slave stack. This should be easy to achieve with attachafter.

Edit: a million typos

I just did something for my needs when I need to have file-browser sticked at master
position and open files from it via dvtm fifo at next positon (after master):

https://github.com/vkochan/dvtm-vk/commit/5cad1584b62523fd6b6a2abcc523db784441bed5

current implementation has disadvantage that it sets sticky mode globally, but better to have it
per tag.

Nice! If extended to work with nmasters >1 it would be a nice way to "freeze" the master area.

I forced my dvtm-vk repo with new changes:

https://github.com/vkochan/dvtm-vk/commit/0e23062c4b68d882d52015a0cec2f2f11e6f6385

  1. added (I assume) stick more masters
  2. fixed impossible to replace sticky master by MOD+Enter
  3. added [*] in border line of each sticked masters (not sure it is needed but at least
    lets know if sticky mode is turned on/off).