NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.88k stars 13.95k forks source link

Plasma5 and i3, better integration of window managers and desktop managers #152986

Open not7cd opened 2 years ago

not7cd commented 2 years ago

As I wanted to run i3wm within Plasma5 DE, I came to this solution.

After enabling both plasma5and i3 nixos generates session profiles. One of them is plasma5+i3, but the config is quite naive, as it doesn't respect how plasma5 expects window manager to be supplied. Only one of them starts, and they don't integrate at all. This session is generated by this script.

https://github.com/NixOS/nixpkgs/blob/06edb74413eb4e4ac56921ef2c038d8f106b15df/nixos/modules/services/x11/display-managers/default.nix

Here is a custom session that enables more proper behavior, at lest in my opinion, and according to previously mentioned solution.

services.xserver.displayManager = {
    sddm.enable = true;
    defaultSession = "plasma5+i3+whatever";
    session = [
        {
            manage = "desktop";
            name = "plasma5+i3+whatever";
            start = ''exec env KDEWM=${pkgs.i3-gaps}/bin/i3 ${pkgs.plasma-workspace}/bin/startplasma-x11'';
        }
    ];
};

I currently would propose to, whenever config for plasma5 is generated:

  1. Don't exec window manager executable before desktop manager
  2. Set env KDEWM=$PATH_TO_WM_EXECUTABLE before executing startplasma-x11
tomberek commented 2 years ago

Perhaps add documentation explaining that one must add an export KDEWM=${pkgs.i3-gaps}/bin/i3 to: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/x11/display-managers/default.nix#L87

Something like

services.xserver.displayManager.sessionCommands = "export KDEWM=${pkgs.i3-gaps}/bin/i3";