I’m on a new installation of Nix, and my current goal is to use replace Kwin with i3 for the window manager of KDE Plasma 6. Currently there are no docs on achieving this in Nix OS. However, there is this resource. This is the configuration that I have tried in order to achieve this, but I’m not sure if this is replacing Kwin. I believe it is installing next to Kwin.
This is the relevant part of configuration.nix
services.desktopManager.plasma6.enable = true;
# Keep Plasma as the desktop environment but use i3
services.xserver.windowManager.i3.enable = true;
My laptop is running out of battery, so I will just say that I plan to excluse kwin in config.nix and report back
So when you disable plasma6 in you config KDE will not be available for the “desktop- part”.
Instead the solution is a bit different:
https://wiki.archlinux.org/title/KDE#Use_a_different_window_manager
It suggests to edit systemd so when starting kde trough displaymanager I3 is started instead of Kwin.
These codes can be used to replace kwin in plasma with i3 in configuration.nix
.
{
services.xserver = {
enable = true;
windowManager.i3 = {
enable = true;
extraPackages = with pkgs; [
dmenu
feh
i3status
picom
];
};
displayManager.session = [
{
manage = "desktop";
name = "plasma-i3wm";
start = "KDEWM=${pkgs.i3}/bin/i3 /run/current-system/sw/bin/startplasma-x11";
}
];
};
services.desktopManager.plasma6.enable = true;
services.displayManager = {
defaultSession = "plasma-i3wm+i3";
sddm.enable = true;
};
systemd.user.services.plasma-kwin_x11.enable = false;
}
1 Like
I tried another method. It also worked. I prefer the second method because it’s faster. When I use the first method, my window will not be displayed for a while after I log in to the system.
services.xserver = {
enable = true;
windowManager.i3 = {
enable = true;
extraPackages = with pkgs; [
dex
feh
i3status
picom
rofi
];
};
};
services.desktopManager.plasma6.enable = true;
services.displayManager = {
defaultSession = "plasmax11";
sddm.enable = true;
};
systemd.user.services.plasma-i3wm = {
wantedBy = [ "plasma-workspace-x11.target" ];
description = "Launch Plasma with i3wm.";
environment = lib.mkForce {};
serviceConfig = {
ExecStart = "${pkgs.i3}/bin/i3";
Restart = "on-failure";
};
};
systemd.user.services.plasma-workspace-x11.after = [ "plasma-i3wm.target" ];
systemd.user.services.plasma-kwin_x11.enable = false;
2 Likes
I was able to use the configuration you provided but I am having trouble logging off. I tried the i3nagbar to log off with Mod+Shift+E which is my keybinding and I also tried logging off with through plasma but these two methods do not work. @HuaHuaY have you experienced this issue?
Yeah, I have met the same issue and it’s a new issue with plasma 6. You can follow this link(Plasma 6 issues · Issue #54 · heckelson/i3-and-kde-plasma · GitHub) to solve it. You need to compile the fakwin
mentioned in the link and run the binary when logging in. I write a exec entry in i3wm’s config to run this.
1 Like
Thanks @HuaHuaY I also found this issue helpful: Nix `home-manager` integration · Issue #3 · DMaroo/fakwin · GitHub. It includes nix configuration for creating the systemd service.
1 Like