Automatic switch "hide border and titlebar" (KWin Script or Window Rule)

hello, maybe somewone can help me :slight_smile:

i used a kwin script, called “Hide Titles” if a window is maximized, the titlebar is gone.

is it possible, to give this effect to a window, wich i move to the corners for tiling view?
a window rule or a kwin script? any idea?

No. At least, not that I know of. Since there is no more tiling in kde, you can’t do it unless you hide titlebars all the time. Maybe, just maybe, there’s a kwin script. But if there is, I doubt it’ll work in 5.27. You could enable that feature with some tilers like Bismuth but they no longer work.
See: https://discuss.kde.org/t/share-your-desktop/490/39

thank you dzon for the link :slight_smile:

i forgott - i’m on 5.27.4 too.

I could be wrong you know. Doubt it though. So, if you want that, I’m afraid setting titlebars hidden all the time is your only option.
So, as default it would look something like this. There is a kwin script that gives you padding between tiles and borders but it will only properly work if you use Breeze window decorations. Not so much if you’d use Klassy or Lightly or something.

@ A.E
You can probably do what you want if you install Devilspie2

BTW Tiling works fine .

Thank you @dzon and @tracyanne :slight_smile:

I used devilspie 10 years ago and had already forgotten.
That could actually work if the conditions are so definable.

What tiling would that be? If you talk about dragging a window to a half or quarter, sure. But Krohnkite, Bismuth…? At least, I don’t have any keyboard shortcuts for it. And I’m very curious how you would undecorate windows that are in a quarter or half layout only with devilspie. I could be wrong though but I doubt it. You can do that with xdotool commands in, say, an openbox environment. But those are predefined areas. How that would work under kde? Probably not. Again, I could be wrong.

In 5.27 there are no longer options for, for example, Bismuth. That is, no keyboard options for different layouts, cycling etc…So you can’t, for example, make desktop applications for certain stuff. You can enable bismuth, use a toggle to switch between Tiling layout and regular floating. But it’ll only do the default layout with the master on the left. But if you’d like to switch to, say, a quarter layout…I’m not sure how to do that. Not, probably. I tried to edit the Bismuth shortcut settings in the kglobalshortcutsrc, but it didn’t work. Doesn’t response. It’s all set to none to begin with.



A failure of imagination, does not make a thing impossible.

To answer I can wait for @ A.E or when I have some time do it myself. But as I’ve already used devilspie2 and some python scripts to achieve other somewhat similar ends, I don’t see the problem.

I already have this:
TiledWindows

1 Like

hello and thank you @all again :slight_smile:

this screenshot shows the “goal” - i try to reach automaticly.

if the windows are aranged to the corners, the borders and titlebars are gone.
currently, this is done through a keyboard shortcut, so it’s done manually.
however, once i move a window using the mouse and it’s no longer in “tiling” mode,
the window frame should reappear.

i want to do this for space-saving purposes since i primarily work on a 15" laptop.
so far, i haven’t found a solution to automatically toggle it.
neither devilspie2 nor a window rule or kwin script has worked for me.

second example screenshot:

You might need to try a python script, and tools like wmctl. I used to use something like that combination to get around the fact that you can’t move to a different workspace - or you couldn’t then (on GNOME), when a window was in Full Screen

perhaps using devilspie2 to launch the python script, then tools like wmctl to find out where the window in question is.

Or maybe launching the python script prior to the actual launching odf the app in question, then auto kill of the python script when the app is closed

thank you @tracyanne, at the moment, i try to write a lua config file for devilspie2.
is there any condition for window position and size (geometry) to deactivate / activate
the titlebar and border? maybe you or someone have a example syntax?

I got my devilspie2 info from

Devilspie2 Manual - gusnan.se Devilspie2 is based on the excellent program Devil’s Pie by Ross Burton, and takes a folder as indata, and checks that folder for LUA scripts. These scripts are run each time a window is opened, and the rules in them are applied on the window. Unfortunately the rules of the original Devils Pie are not supported.

you may also find this helpful

if (get_window_class()=="konsole") then

    decorate_window()
    set_window_size (800, 600)

    os.execute("/home/tracyanne/.config/devilspie2/load_konsole.py")
    
    local f = io.open("/home/tracyanne/.config/devilspie2/result.konsole", "r")
    local t = f:read("*line")
    local s = f:read("*line")
    f:close()
    
    print(t)
    print(s)
    
    if (t=="False") then
        print("New Main Window")
        undecorate_window()
        set_window_workspace(7)
        set_window_fullscreen(true)
    else
        print("New Standard Window")
        decorate_window()
        set_window_size (800, 600)
    end
  
end

2 Likes

thats great! thank you @tracyanne :slight_smile: