Floating rules for scratchpad

Issue #45 resolved
Viktor created an issue

How to specify a rule that if I see the following class value for a terminal?

WM_CLASS(STRING) = "scratchpad", "st-256color"

I try the following:
dkcmd rule class="^scratchpad st-256color$" scratch=true float=true x=center y=center
dkcmd rule class="^scratchpad:st-256color$" scratch=true float=true x=center y=center

But not work

Comments (3)

  1. Nate Maia repo owner

    Hey sorry for the delay, so with the xprop WM_CLASS section, it has both the class and instance.

    I use the following alias because I always forget the order

    alias xp='xprop | awk -F\"'" '/CLASS/ && !/awk/ {printf \"INSTANCE = %s\nCLASS = %s\n\", \$2, \$4}'"
    

    Now you can use that to match with the dk rule, in this case it would be something like

    dkcmd rule class="^st-256color$" instance="scratchpad" scratch=true float=true x=center y=center
    

    But this shouldn’t be necessary, you can just set the class of most terminals and match only that, so like

    dk rule

    dkcmd rule class="^scratchpad$" scratch=true float=true x=center y=center
    

    spawning the scratchpad terminal (other terminals will have a similar flag)

    st -c scratchpad
    

    Let me know if that makes sense and solves the issue.

  2. Viktor reporter

    Ohh. The first string not the class, but instance. I dont know this. And I used st -n, but this wrong, because set instance, not class. I modified, and now, working fine. Thank u!

  3. Log in to comment