complete-computing-environment/kde-base.org

125 lines
4.9 KiB
Org Mode

:PROPERTIES:
:ID: cce/kde_is_a_base_for_my_emacs_desktop
:ROAM_ALIASES: kde-base KDE
:END:
#+TITLE: KDE is a Base for my Emacs Desktop
#+filetags: :Emacs:CCE:System:
#+PROPERTY: header-args :mkdirp yes :results none
#+PROPERTY: header-args:emacs-lisp :tangle kde-desktop.el
#+PROPERTY: header-args:yaml :tangle roles/endpoint/tasks/kde-desktop.yml
#+ARROYO_EMACS_MODULE: kde-desktop
#+ARCOLOGY_KEY: cce/kde-desktop
#+CCE_ANSIBLE: kde-desktop
#+CCE_PREDICATE: (and (cce/using-linux) (cce/has-display-frames))
#+CCE_PRIORITY: 30
#+ARROYO_MODULE_WANTS: cce/super_p_runs_commands.org
#+ARCOLOGY_ALLOW_CRAWL: t
#+begin_src emacs-lisp
(provide 'cce/kde-desktop)
#+end_src
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.
#+BEGIN_SRC shell
KDEWM=/usr/bin/emacs
#+END_SRC
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 [[id:cce/exwm_should_ignore_plasma_notifications][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:
#+begin_src emacs-lisp
(defun logout ()
(interactive)
(background-shell-command "qdbus org.kde.ksmserver /KSMServer logout -1 2 3"))
#+end_src
* Installing KDE on [[id:cce/my_nixos_configuration][My NixOS configuration]]
:PROPERTIES:
:ID: d2af4461-e949-45ee-96a8-70501194188d
:END:
This is the bare-minimum for me; most of the applications are arbitrarily managed in home-manager e.g. [[id:cce/applications_i_use][Applications I Use]] so that they're available on home-manager+linux systems.
I customize my KDE installation a fair bit both within [[id:cce/home-manager][home-manager]] and without. Consider in particular setting up dynamic keybindings with [[id:20220208T202524.889588][A simple invocation]] of [[id:20220208T211139.833662][Declarative KDE Defaults]] or [[id:20220517T150556.220165][default/preferred desktop shortcuts]].
#+ARROYO_NIXOS_MODULE: nixos/kde.nix
#+ARROYO_SYSTEM_ROLE: endpoint
#+begin_src nix :tangle ~/arroyo-nix/nixos/kde.nix
{ 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
(libsForQt5.bismuth.overrideAttrs
(finalAttrs: previousAttrs: {
patches =
(previousAttrs.patches or [])
++ [
# (fetchpatch {
# name = "bismuth-3.1-4-border-color.patch";
# url = "https://github.com/I-Want-ToBelieve/bismuth/commit/dac110934fe1ae0da9e4aca8c331f27987b033cf.patch";
# sha256 = "sha256-3fQs/A4hc/qeiu+792nZBTl4ujg8rQD25kuwNr03YUs=";
# })
# (fetchpatch {
# name = "bismuth-3.1-4-static-block.patch";
# url = "https://github.com/I-Want-ToBelieve/bismuth/commit/99438b55a82f90d4df3653d00f1f0978eddc2725.patch";
# sha256 = "sha256-jEt0YdS7k0bJRIS0UMY21o71jgrJcwNp3gFA8e8TG6I=";
# })
(fetchpatch {
name = "bismuth-3.1-4-window-id.patch";
url = "https://github.com/jkcdarunday/bismuth/commit/ce377a33232b7eac80e7d99cb795962a057643ae.patch";
sha256 = "sha256-15txf7pRhIvqsrBdBQOH1JDQGim2Kh5kifxQzVs5Zm0=";
})
];
}))
]);
# auto login
services.xserver.enable = true;
services.xserver.displayManager = {
autoLogin.enable = true;
autoLogin.user = "rrix";
defaultSession = "plasmawayland";
lightdm.enable = true;
};
}
#+end_src