complete-computing-environment/kde-base.org

3.8 KiB

KDE is a Base for my Emacs Desktop

(provide 'cce/kde-desktop)

Since I first started using Linux from a live-image collection DVD in the back of Fry's Electronics magazine, I have been a use of the various KDE desktop environments, or more specifically the KDE desktop's various incarnations over the years from KDE 3.5.9.

I've spent time exploring basically every other Desktop Environment under the sun over the years, but KDE is the right balance of smart design choices, and malleable user-choices. This is one of the few desktop environments that still, for example, make it easy to swap your window manager software easily.

If I wanted to install EXWM as my default window manager, rather than allowing it to kill kwin when EXWM is ready to load, I could simply place this in ~/.config/plasma-workspace/env/ and KDE will read the file, and use it.

KDEWM=/usr/bin/emacs

And EXWM works really well with most of the KDE Plasma system. I don't really see my desktop of course, but the panel which has my list of X11 applications, my "system tray", etc, are still fully functional, once I learned that EXWM [can and] should ignore Plasma notifications.

I have a simple function M-x logout that will signal to KDE's Session Manager via D-BUS to trigger a desktop logout, as though I'd hit the logout button on the Application Launcher:

(defun logout ()
  (interactive)
  (background-shell-command "qdbus org.kde.ksmserver /KSMServer logout -1 2 3"))

Installing KDE on My NixOS configuration

This is the bare-minimum for me; most of the applications are arbitrarily managed in home-manager e.g. Applications I Use so that they're available on home-manager+linux systems.

I customize my KDE installation a fair bit both within home-manager and without. Consider in particular setting up dynamic keybindings with A simple invocation of Declarative KDE Defaults or default/preferred desktop shortcuts.

{ pkgs, ... }:
{
  security.pam.services.login = {
    enableKwallet = true;
    startSession = true;
  };

  # use plasma5
  services.xserver.desktopManager.plasma5.enable = true;

  environment.systemPackages = (with pkgs.libsForQt5; [
    breeze-gtk
    kde-gtk-config
    breeze-qt5
    kdesu

    plasma-systemmonitor
    kio-extras
    kipi-plugins
    plasma-browser-integration

    xdg-desktop-portal-kde
    systemsettings
    bluedevil
  ]) ++ (with pkgs; [
    # core kde applications
    ark
    dolphin
    filelight
    gwenview
    konsole
    okular
    libreoffice-qt
    partition-manager
    gparted
    plasma5Packages.kamoso
    plasma5Packages.bismuth
  ]);

  # auto login
  services.xserver.enable = true;
  services.xserver.displayManager = {
    autoLogin.enable = true;
    autoLogin.user = "rrix";
    defaultSession = "plasma";
    lightdm.enable = true;
  };
}