5

How can I use i3 Window manager with KDE 5?

I recently installed KDE 5.15 on Arch Linux and cannot switch window manager to i3.

I also installed i3 for KDE from AUR. I tried solutions like this and set environmental variable in .xinitrc as described in this post, but had no luck so far.

1
  • 1
    I hope you figured it out, but if not (or for others). The link you referenced above(stackoverflow.com/questions/21616473/…), says the environment variable is KDE_WM. NO! The correct environment variable is KDEWM
    – user526434
    Nov 26, 2015 at 4:07

2 Answers 2

2

I just wrote a blog post to cover this topic. Melkor33's solution works, but it's not very clean, IMO (to revert to plain Plasma, you have to go in and edit a configuration file); I believe my approach is more "correct", even if it is a smidge more work.

If you've already got i3 installed (I recommend i3-gaps), it basically boils down to two steps: 1) configure i3 to be Plasma-friendly, and 2) configure your display manager (login screen) to add an option for Plasma + i3.

Configure i3 to be Plasma-friendly

Add the following lines to ~/.config/i3/config:

# Don’t treat Plasma pop-ups as full-sized windows
for_window [class="plasmashell"] floating enable

# Don’t spawn an empty window for the Plasma Desktop
for_window [title="Desktop — Plasma"] kill, floating enable, border none

Configure your display manager to add an option for Plasma + i3

I use sddm (default on Debian), so if you're using another display manager (cat /etc/X11/default-display-manager), you'll have to look into the configuration options.

# Create a plasma + i3 launcher script
$ echo -e "#!/bin/sh\n\nKDEWM=/usr/bin/i3 startkde" > /usr/local/bin/startkde-i3
$ sudo chown root.staff /usr/local/bin/startkde-i3
$ sudo chmod 755 /usr/local/bin/startkde-i3

# Create a custom desktop sessions directory
$ sudo cp -a /usr/share/xsessions /usr/local/share/xsessions

# Create a new desktop session file for plasma + i3
$ cp /usr/local/share/xsessions/plasma.desktop /usr/local/share/xsessions/plasma-i3.desktop
$ sudo sed -i 's|/usr/bin/startkde|/usr/local/bin/startkde-i3|' /usr/share/xsessions/plasma-i3.desktop
$ sudo sed -i '/Name.*=/ s/$/-i3/' /usr/share/xsessions/plasma-i3.desktop

# Configure sddm (the login screen) to use our new desktop sessions directory
$ echo -e "\n\n[X11]\nSessionDir=/usr/local/share/xsessions" | sudo tee -a /etc/sddm.conf
1
  • 1
    Worth noting, there's another tutorial, it is much cleaner IMO because it considers various corner cases. And it's contributable too :) Works for me, I'm writing this from a freshly configured KDE + i3, so far everything is nice and dandy.
    – Hi-Angel
    Apr 12, 2020 at 10:10
0

You can set the environment variable if you create the following file:

~/.config/plasma-workspace/env/wm.sh

which contains the line

export KDEWM=i3wm

(got the answer from this github project which is probably worth checking out if you're interested in KDE + i3)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .