Combining KDE with i3
KDE has been my desktop environment on GNU/Linux distributions for several years as I think it is the most feature-complete among other DEs. Previously I was using either XFCE, or just i3. As I have switched to a multi-monitor environment, the main monitor being horizontal and the side monitor being vertical, the need for tiling was more than ever. In vanilla KDE, you can only divide the screen to two using Super + arrow keys, but since I can easily fit 3 windows on my vertical monitor, I needed more than that. As a solution, I opted to replace the KDE window manager with i3, but as I went down the road, many other things also needed replacement. As a baseline, this repository helped me a lot.
First, you need to install i3 or i3-gaps. Then, you need to create a user service to start i3 before plasma workspace, to do that, create this file:
$HOME/.config/systemd/user/plasma-i3.service [Unit] Description=Launch Plasma with i3 Before=plasma-workspace.target [Service] ExecStart=/usr/bin/i3 Restart=on-failure [Install] WantedBy=plasma-workspace.target
Then, mask plasma-kwin_x11.target and enable the newly created service like this:
systemctl mask plasma-kwin_x11.target --user systemctl enable plasma-i3 --user
To fix layout issues, you have to make several windows floating and kill the plasma desktop as it covers the entire desktop, preventing you to do anything.
# Plasma compatibility improvements for_window [window_role="pop-up"] floating enable for_window [window_role="task_dialog"] floating enable for_window [class="yakuake"] floating enable for_window [class="systemsettings"] floating enable for_window [class="plasmashell"] floating enable; for_window [class="Plasma"] floating enable; border none for_window [title="plasma-desktop"] floating enable; border none for_window [title="win7"] floating enable; border none for_window [class="krunner"] floating enable; border none for_window [class="Kmix"] floating enable; border none for_window [class="Klipper"] floating enable; border none for_window [class="Plasmoidviewer"] floating enable; border none for_window [class="(?i)*nextcloud*"] floating disable for_window [class="plasmashell" window_type="notification"] border none, move right 700px, move down 450px no_focus [class="plasmashell" window_type="notification"] for_window [title="Desktop — Plasma"] kill; floating enable; border none
If you use a single monitor, you can just use feh to set your wallpaper, but if you use multiple monitors, I recommend using nitrogen instead. Also if your monitors have different layout, I recommend you to run xrandr before running nitrogen like this in your i3 config:
exec --no-startup-id xrandr --output DVI-I-1 --rotate right --pos 1920x0 && xrandr --output HDMI-0 --primary --pos 0x677 exec --no-startup-id nitrogen --restore
Since by replacing the KDE window manager we are also removing compositing, you might want to use a replacement compositor such as picom. If you compile it from source, you can enable experimental backends that enable you to use blur. You can run it like this in your i3 config:
exec --no-startup-id picom --experimental-backends -b
You also might want to autostart kwallet.
exec --no-startup-id /usr/lib/pam_kwallet_init
If you use a single monitor, the default KDE notifications will appear fine, but if you use multiple monitors, sometimes you might see them in the middle of your screen, which is really annoying. As a workaround, you might want to replace it with dunst instead.
exec --no-startup-id dunst
These are the workarounds for broken stuff when you replace the KDE window manager, but if you want, you can go further by replacing the KDE taskbar with the one from i3 and start your applications using either dmenu or rofi but at that point you might just want to start creating your environment from scratch instead of piggybacking KDE.