Starting KF5 using the I3 window manager

Lately I started experimenting several tiling window managers, and I settled on I3 (see its Official site and the corresponding ArchLinux wiki page)

I now plan to return hacking KF5 and I’d like to use this tiling manager. In KDE4 I simply used the “Default Applications” control module from “System Settings” to choose i3, after adding the right i3.desktop file. However, with KF5 that will not be enough. For some reason kwin will still be loaded. (And BTW, the new kwin looks really great. I also like the new plasma desktop very much, but it won’t fit my workflow, as I prefer tiling WMs paradigm) Today I started searching a quick way to workaround that and here it is what I did.

Firstly, create the $KF5/share/ksmserver/windowmanagers/i3.desktop file with this contents:

[Desktop Entry]
Encoding=UTF-8
Name=i3
Comment=Highly configurable framework window manager
Type=Application
Exec=i3
TryExec=i3

Then edit the file ~/.config/ksmserverrc and modify the windowManager line from the [General] section:

[General]
# other lines ommited
windowManager=i3

Alternatively, you can use the “Default Applications” control module from KF5 System Settings to change the window manager to i3.

Finally, here is the little bit that made it. Modify the KF5 startup script to define the KDEWM environment variable. It should read like this:
export KDEWM=/usr/bin/i3

Here is how:
On my system, I’m using kdm. For it to start a KF5 session, I created /usr/share/config/kdm/sessions/kf5.desktop with this contents:

[Desktop Entry]
Encoding=UTF-8
Type=XSession
Exec=/home/kde5/start-kf5
TryExec=/home/kde5/start-kf5
DesktopNames=KF5
Name=KF5

As you can see, my KF5 is installed in /home/kde5 (others may have it in /opt/kf5). The start-up script, named ‘start-kde’ simply sets the righ environment variables, calls ssh-agent and gpg-agent, then calls startkde from KF5. I added the export KDEWM=/usr/bin/i3 line into this script.

Quit your current session, choose the KF5 session in KDM and enjoy I3 with KF5!

I’ll now return to tinkering it, as some adjustments still need to be done 🙂

  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

8 thoughts on “Starting KF5 using the I3 window manager”

  • Thank you for the advice!
    Just a small hint: KDE Frameworks 5 (KF5) are just the libraries, you cannot “start KF5”. What you start is Plasma 5.
    I know it’s difficult to tell the different brands apart and we probably cann’t prevent many people from saying “KDE 5” instead of “Plasma 5”, but if people start calling the desktop “KF5”, our whole branding goes down the drain.

  • Yeah, I also use KF5 with Awesome, but I did it in another way: I use a xinitrc script which runs kded5 and then it starts awesome. It’s cool 🙂

  • Is this really necessary? I use xmonad with the current stable version of Plasma Desktop (4.11), and I just had to put a script in ~/.kde4/env with the contents

    #!/bin/bash
    export KDEWM=/usr/bin/xmonad

    Maybe you can try and see if it works in Plasma 5.

    • Well, your solution is pretty equivalent to the one I’m describing here so it would surely work. However, ~/.kde4/ directory will no longer be used. KF5 switched to the XDG directories, ~/.config and ~/.local

  • steverweber says:

    I do it kinda backwards…

    1 – launch kde as norm
    2 – run: sh -c ‘killall kwin_x11 ; i3’

  • Hello and thank you for that tutorial,
    I’ve just installed plasma5 (only the desktop) and added the i3.desktop file in /usr/share/ksmserver/windowmanagers for which I had to create the windowmanagers folder, but I I can’t see the window manager option in the Default Applications settings.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>