There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

How to make a rule for all fullscreen windows to also automatically go "Keep Below Others"? [KDE]

I tried making it work, but I failed to. Can someone post a screen of a working rule set up for it?

Posting to this community as well in hopes someone may know. I’m not sure if it’s broken, but following the documentation for the window rules didn’t yield any results. :(

tubbadu ,

“fullscreen” cannot be used as a condition in windows rules AFAIK, but you can achieve this with a simple kwin script (the syntax is very easy, nothing to be scared with). You can find on the KDE website a tutorial and the whole API set.
Let me show you: We are going to add an event listener listening to any client going fullscreen (or de-fullscreening), and then we will apply the “keep below” property to the fullscreen ones.
you first need to add a rule to listen to clients changing fullscreen status: (references)


<span style="color:#323232;">workspace.clientAdded.connect(client </span><span style="font-weight:bold;color:#a71d5d;">=> </span><span style="color:#323232;">{
</span><span style="color:#323232;">    client.fullScreenChanged.connect(</span><span style="font-weight:bold;color:#a71d5d;">function</span><span style="color:#323232;">() {fullscreenChanged(client)})
</span><span style="color:#323232;">});
</span>

This will call the function fullscreenChanged each time a new client changes its fullscreen status, passing to the function the client. ( I don’t know why but workspace.clientFullScreenSet does not work, it would have been better, but whatever)

We need now to write the fullscreenChanged function. It should change the KeepBelow status, evaluating if the client has been fullscreened or de-fullscreened:


<span style="font-weight:bold;color:#a71d5d;">function </span><span style="font-weight:bold;color:#795da3;">fullscreenChanged</span><span style="color:#323232;">(client){
</span><span style="color:#323232;">    </span><span style="color:#795da3;">console</span><span style="color:#323232;">.</span><span style="color:#0086b3;">warn</span><span style="color:#323232;">(client, client.fullScreen) </span><span style="font-style:italic;color:#969896;">// not needed, just to debug 
</span><span style="color:#323232;">    </span><span style="font-weight:bold;color:#a71d5d;">if</span><span style="color:#323232;">(client.fullScreen){
</span><span style="color:#323232;">        </span><span style="font-style:italic;color:#969896;">// set as keep below
</span><span style="color:#323232;">        client.keepBelow </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#0086b3;">true</span><span style="color:#323232;">;
</span><span style="color:#323232;">    } </span><span style="font-weight:bold;color:#a71d5d;">else </span><span style="color:#323232;">{
</span><span style="color:#323232;">        </span><span style="font-style:italic;color:#969896;">// unset as keep below
</span><span style="color:#323232;">        client.keepBelow </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#0086b3;">false</span><span style="color:#323232;">;
</span><span style="color:#323232;">    }
</span><span style="color:#323232;">}
</span>

so the final script will be:


<span style="font-weight:bold;color:#a71d5d;">function </span><span style="font-weight:bold;color:#795da3;">fullscreenChanged</span><span style="color:#323232;">(client){
</span><span style="color:#323232;">    </span><span style="color:#795da3;">console</span><span style="color:#323232;">.</span><span style="color:#0086b3;">warn</span><span style="color:#323232;">(client, client.fullScreen) </span><span style="font-style:italic;color:#969896;">// not needed, just to debug 
</span><span style="color:#323232;">    </span><span style="font-weight:bold;color:#a71d5d;">if</span><span style="color:#323232;">(client.fullScreen){
</span><span style="color:#323232;">        </span><span style="font-style:italic;color:#969896;">// set as keep below
</span><span style="color:#323232;">        client.keepBelow </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#0086b3;">true</span><span style="color:#323232;">;
</span><span style="color:#323232;">    } </span><span style="font-weight:bold;color:#a71d5d;">else </span><span style="color:#323232;">{
</span><span style="color:#323232;">        </span><span style="font-style:italic;color:#969896;">// unset as keep below
</span><span style="color:#323232;">        client.keepBelow </span><span style="font-weight:bold;color:#a71d5d;">= </span><span style="color:#0086b3;">false</span><span style="color:#323232;">;
</span><span style="color:#323232;">    }
</span><span style="color:#323232;">}
</span><span style="color:#323232;">
</span><span style="color:#323232;">workspace.clientAdded.connect(client </span><span style="font-weight:bold;color:#a71d5d;">=> </span><span style="color:#323232;">{
</span><span style="color:#323232;">    client.fullScreenChanged.connect(</span><span style="font-weight:bold;color:#a71d5d;">function</span><span style="color:#323232;">() {fullscreenChanged(client)})
</span><span style="color:#323232;">});
</span>

you can follow the instruction on the tutorial on how to install it. Hope this helps!
(I haven’t tested it much, in case of any problem feel free to ask!)

phx ,

If you can’t get it to work with KDE tools, try devilspie2 for scripted window management, and “xinfo” to figure out what’s what

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines