dkcmd does not apply rule to a specified app when asking for a certaon app to be tiled.

Issue #44 resolved
It was Powwo created an issue

Hello, what I am trying to accomplish is, make all the windows floating by default, and then specify certain apps to be tiled when opened, basically the opposite of what it is now where everything is tiled by default and then specify apps to be floating.

When I have these commands in me dkrc file:

dkcmd rule class = “.*” float=true
dkcmd rule class = “^Terminator$” float=false
dkcmd rule apply '*'

It appears to have no effects. Even when running parts of them in the terminal.

I’m not too sure if this is bug or I’m not doing this right.

If this was accidentally a mislabeled “kind”, then I apologize for this.

I did run a Google search for hours about this issue before post here.

Comments (8)

  1. Nate Maia repo owner

    order does matter, try placing the catch all last rather than first, seemed to work for me on a quick test. use dkcmd status type=full num=1 to see the rule order (first match) since they’re allocated and placed at the head of the list.

  2. It was Powwo reporter

    So I tried swapping command 1 and 2 around that I posted first, no effect.

    Using that status command you provided, I noticed that if I do this in the terminal:

    dkcmd rule remove '*'; dkcmd rule class = “^Terminator$” float=true; dkcmd rule apply '*'
    

    It shows up on the rule list. If I switch float to false, it does not show up.

    Also when I do this:

    dkcmd rule remove '*'; dkcmd rule class = “^Terminator$” float=false; dkcmd rule class = “.*” float=true; dkcmd rule apply '*'
    

    Only the “.*” rule shows up no matter what order I use.

    Since the it worked for you, I tried to understand what you were trying to say I am still missing something.

    What was the code to do this?

  3. Nate Maia repo owner

    Sorry for the delay I’ve just been really busy the last couple weeks and dealing with a hard crash issue.

    Back on this as priority, will let you know if I have an answer soon.

  4. Nate Maia repo owner

    Using the following rule set I was able to get the desired effect

    dkcmd rule class=".*" float=true
    dkcmd rule class="^scratchpad$" scratch=true
    dkcmd rule class="^st-256color$" terminal=true
    dkcmd rule apply '*'
    

    Essentially you NEED to define the catch-all first then apply any subsequent rules to make those windows tiled.

    Since rules are pushed on to the head of the rule list the order is basically reversed from dkrc (last rule defined is checked first).

    Providing float=false is not needed but is perfectly fine to be used if you prefer the clarity of the rule’s function but NOT-FLOATING is the default state.

    Hope that makes sense.

    The rules section of dkcmd status type=full num=1 looks like this with the above rule set

    # title class instance workspace monitor float full fakefull stick ignore_cfg ignore_msg focus callback x y width height xgrav ygrav
    rule: "(null)" "^st-256color$" "(null)" -1 (null) 0 0 0 0 0 0 0  -1 -1 -1 -1 none none
    rule: "(null)" "^scratchpad$" "(null)" -1 (null) 0 0 0 0 0 0 0  -1 -1 -1 -1 none none
    rule: "(null)" ".*" "(null)" -1 (null) 1 0 0 0 0 0 0  -1 -1 -1 -1 none none
    

    Let me know if that works and I can close this.

    Cheers,

    Nate

  5. It was Powwo reporter

    This sort of works for me.

    But some tweakings are needed on my side to get it perfect.

    This can be closed now.

  6. Log in to comment