KDE with Awesome WM

I have been using KDE for a while now, but I started to feel that a tiling window manager might help me. So instead of dropping KDE as a whole, I just replaced KWin with Awesome WM.

Here are a couple things that I found out during that transition.

You can find my complete rc.lua in this git repository:

GitHub Page

git clone git://github.com/martin-ueding/awesome-config.git

Awesome WM as window manager in KDE

The first thing is to replace KWin with Awesome WM. The following snippet has to go into an executable file. On KDE 4 it has to go into ~/.kde/env/SOMETHING and on KF 5 it has to go into ~/.config/plasma-workspace/env/SOMETHING.

export KDEWM=awesome

I chose SOMETHING to be set_window_manager.sh but anything should work there.

One can alternatively do this also in the system settings. There in the “default applications” is a setting to chose the window manager. This has crashed for me since it could not start Awesome WM. Therefore I use the configuration file.

Floated windows in tiling layout

Even though I have a tiling layout by default on all tags (workspaces), some programs like Konsole and Dolphin were started floating every single time. The problem appears to be that windows can be maximized horizonally or vertically, and therefore trigger them to be floated.

In the rc.lua, I added the following two properties to the general rule:

awful.rules.rules = {
    -- All clients will match this rule.
    { rule = { },
      properties = { --
                     --
                     --
                     --
                     maximized_vertical = false,
                     maximized_horizontal = false,
                     --
                 } },
}

That fixed it, all windows that I want tiled are tiled now.

Floating KDE Panel Drawers

The Plasma panels are tiled for some reason, although I supplied a properties = { floating = true } in the rules section of the rc.lua. It turns out that setting them to a fixed size and setting them to float makes it work on the second click of any of the drawers. If you open them for the first time, they get the fixed size, but in the upper left corner of the screen. When you close and open them again, they appear in the right spot, like so:

../../_images/panel.png

This is the snippet that sets the fixed size:

{
    rule = { class = "Plasma-desktop" },
    properties = { floating = true },
    callback = function(c)
        c:geometry( { width = 600 , height = 500 } )
    end,
},

I have no idea why it did not work before, but this is a workaround for me.

Plasma window switcher steals focus

By default, you have the “wibox” of Awesome WM at the top and the KDE Plasma panel at the bottom. This is redundant, since I do not need two switchers for workspaces (“tags” in Awesome WM language) and windows (“clients”). But I do need the network, removable devices and sound controls which only live in the Plasma panel. Therefore, I set the Plasma panel to auto-hide.

There is a subtle problem: When I run Skype and receive a chat message, Awesome will not let Skype steal my focus. The window switcher in the Plasma bar will pop up though, therefore stealing the focus. If you continue typing, KRunner will open and capture your keyboard input. This makes it completely unusable.

The solution is to remove the application switcher from the Plasma panel, see above screenshot. You do not need it anyway, since it does not understand the tags that Awesome uses.

Prevent closing of plasma-desktop

With Mod4 + C you can close the currently focus program. However, it might happen that plasma-desktop has the focus. That is what displays the background image, shows the Plasma widgets and the Plasma bar. I occasionally closed plasma-desktop by accident, so I have prevented it now.

In the default config, there is a binding for modkey and c. That will just kill the client. To filter for plasma-desktop I let it call another function like so:

clientkeys = awful.util.table.join(
    --
    awful.key({ modkey, }, "c", wrapped_kill),
    --
)

That function is declared above like this:

function wrapped_kill(client)
    if client.class ~= 'Plasma' then
        client:kill()
    end
end

Now I cannot kill any Plasma application by accident. You could extend this to prevent minimizing or maximizing of Plasma altogether.