Monitor-independent workspaces

Hi there again, so, since I can’t fix my problem with workspaces and monitors I ended up setting dkmcd set static=true.

The only thing is that with static workspaces the more comfortable thing for me is to have n layouts on every monitor, independent. So I’m not talking about ws 1…10 on monitor 1 and ws 11…20 on monitor 2, what I’d like to achieve is to have 1…10 on both monitors and to control them focusing the monitor, like, for example, as it is in dwm by default.

Would that be possible?

Hi @loyak , what if you set static=false later in your dkrc file:

dkmcd set static=true
blablabla
dkmcd set static=false

I think this is because of the way dk detects monitors, I mean some outputs will be turned on before others, that the case for me I have a 3 monitors setup and my HDMI monitor will be the last one to get ready even it is in the middle so workspaces will be distributed kind of weird. @natemaia
Can you post the result of:

dkcmd status type=full num=1 | awk -F":" ‘/^monitors:/ {sub(/^monitors: / ,“”); print $2" "$4; exit}’

Or just checkout

dkcmd status type=full num=1

…and look if your monitors are in proper order.

1 Like
dkmcd set static=true
blablabla
dkmcd set static=false

This solved my inverted monitor problem so thank you very much!

Anyway this is a workaround and yes, after endlessly tweaking the primary monitor with xrandr and xorg I get that it’s useless, I’m sure that it’s related to the way dk detects monitors. I couldn’t find anything useful about it and, while I’m happy to use this workaround you suggested, it would be nice to understand more about it.

dkcmd status type=full num=1 | awk -F":" ‘/^monitors:/ {sub(/^monitors: / ,“”); print $2" "$4; exit}’

What’s this for? It just gives me bash: syntax error near unexpected token ('`

dkcmd status type=full num=1

This confirmed what I was saying! My monitors are indeed inverted:

    monitors: 1:HDMI-0:6 *2:eDP-1-1:1
	# number:name active_window x y width height wx wy wwidth wheight
	1:HDMI-0 0x0060002d 0 0 2560 1440 0 0 2560 1412
	2:eDP-1-1 0x00800002 320 1440 1920 1080 320 1440 1920 1052

My primary monitor is eDP-1-1, but the result is always this no matter what I try.

EDIT: In my dkrc I do have

      mon1='eDP-1-1'
	  mon2='HDMI-0'

but it seems like it’s being ignored.

This is what I suspected, we will have to wait what @natemaia will say about monitors detection and specifically HDMI connection.
Quotes have been misinterpreted by blockquotes forum feature, this must be good now: (that will give you your monitors names if you have 2 of them)

dkcmd status type=full num=1 \
| awk -F ":" '/^monitors:/ {sub(/^monitors: /, ""); print $2" "$4; exit}'

Yeah, I’ll wait, no problems since I have this workaround for now.

dkcmd status type=full num=1 \
| awk -F ":" '/^monitors:/ {sub(/^monitors: /, ""); print $2" "$4; exit}'

Now it works and yes, it says the same thing: HDMI-0 eDP-1-1.

So now we wait.
In the meantime I’d have another question, but is this the appropriate place to ask?
I couldn’t find anywhere a way to create issues like on github so I don’t want to mess if this is not the right place.

Anyway…
Besides this monitor/workspace stuff, the only thing I’m not comfortable with, in dk, is the fact that I can’t focus windows like in bspwm mapping the key to north,west,south,east and I can just select the previous/next window, which is kinda weird when you have a lot of windows through the monitor and being able to just go up/down/left/right would make sense to me. Do you know if this is possible somehow?

 ________________________________________________________________
|    win 1                      |  win 2                        |
|                               |                               |
|                               |                               |
|                               |                               |
|                               |_______________________________|
|                               |  win 3                        |
|                               |                               |
|                               |                               |
|                               |                               |
|                               |_______________________________|
|                               |  win 4         | win 5        |
|                               |                |              |
|                               |                |              |
|                               |                |              |
|_______________________________|________________|______________|

Win 1 is focused.
If you want to focus win 3: dkcmd win focus +2
If you want to focus win 5: dkcmd win focus +4

Now when on win 5 you want to focus wind 2: dkcmd win focus +2
and you want to focus win 5 again : dkcmd win focus +3
then if you want to focus win 4: dkcmd win focus -1

sxhkdrc shortcut example up to 10 windows:

super + ctrl + {1-9,0}
    dkcmd win focus +{1-9,10}

super + alt + {1-9,0}
    dkcmd win focus -{1-9,10}

This if useful so thank you, I’ll experiment with it.

What I meant, though, was moving in all directions using Left, Right, Up and Down. Like I’m on win 3, I want to focus win 2 and I just: whathever + Up
From win 2 I want to focus win 1: whathever + Left.
From win 4 focus win 5: whathever + Right

And so on. Right now I can just go to previous or next, so just Left/Right or Up/Down.
I hope it makes sense.

The way you did show seems cool but maybe I can’t always remember the number of every window so it might be slower for me than just navigate with arrows through windows.

@loyak dk only has one list of workspaces, you can have as many as you want and tie them to monitors but there’s no way to have e.g. ws 1 on more than one monitor. Dwm doesn’t use a single list and is more monitor-centric, so each monitor will have a ws 1.

1 Like

This is what I suspected, but thanks to @archus’ workaround now I’m embracing the dynamic workspaces even if my monitors apparently want to stay inverted no matter what I try :slight_smile:

Anyway thank you for confirmation.

2 Likes

@loyak @natemaia Another way will be to call at the end of the dkrc file:

dkcmd mon $mon1; dkcmd ws 1

(ws 1 is the first workspace on monitor 1) So the focus will be right and it will force to start your session with the workspaces in the right order.
Hey nate do you have that “issue” on multi-heads?