User:Screenager/install/minimal KDE PLASMA

From Gentoo Wiki
Jump to:navigation Jump to:search


With gentoos unlimited options this page will document a way to get a working minimal KDE Plasma setup running. It is meant as a 'sane default' to provide a desktop environment even usable by 'non computer persons'. It is assumed that a fresh amd64/desktop/plasma installation is either booted or chrooted into.

Installing KDE plasma meta

When installing gentoo with the amd64/dekstop/plasma profile many necessary functions are already setup.

root #equery hasuse elogind
[IP-] [  ] sys-apps/dbus-1.15.6:0
[IP-] [  ] sys-auth/pambase-20220214:0
[IP-] [  ] sys-process/procps-3.3.17-r2:0/8

Now is the time to configure some useflags to disable unwanted software:

FILE /etc/portage/make.conf
USE="-vlc -kwallet"
To disable kwallet it is still necessary to do this

to solve a circular dependency first emerge libsnd with the use flag 'minimal' without adding it to your @world set

root #USE="minimal" emerge --ask --oneshot libsndfile

then emerge the kde-plasma/plasma-meta package

root #emerge --ask kde-plasma/plasma-meta
You can go through and install desired packages manually

currently there is no terminal emulator installed to change that there are two ways: Emerge the kdecore meta package or manually install basic packages.

Option A: Meta Package

Kdecore-meta packages includes the light weight Falkon Browser. To disable it deactivate the webengine USE flag from it's package. This is optional
FILE /etc/portage/make.conf
USE="-vlc -kwallet -webengine"
root #emerge --ask kde-apps/kdecore-meta
Compiling QtWebEngine will take a very long time, more than anything else compiled so far, so be aware when not exluding the webengine useflag

Option B: Manual Install

A filebrowser:

root #emerge --ask kde-apps/dolphin

Video thumbnail generation:

root #emerge --ask kde-apps/ffmpegthumbs


root #emerge --ask kde-apps/kfind

GUI assisted KDE manual and provides a graphical interface to view all man pages of every installed program:

root #emerge --ask kde-apps/khelpcenter

Most important a terminal emulator:

root #emerge --ask kde-apps/konsole

Thumbnail generation

root #emerge --ask kde-apps/thumbnailers

and one text editor of choice (both are basically the same, kate offers a little bit more options and plugins)

root #emerge --ask kde-apps/kwrite


root #emerge --ask kde-apps/kate

Further KDE Apps

Next we add some essential programs without emerging further meta packages, start with kmenuedit which will allow easier customization of the app launcher.

root #emerge --ask kde-plasma/kmenuedit

Gwenview which is a simple image viewer

root #emerge --ask kde-apps/gwenview

Okular - a basic document including PDF viewer

root #emerge --ask kde-apps/okular

Spectacle a screenshot and annotation tool

root #emerge --ask kde-apps/spectacle

p7zip which is an improved clone of 7zip for handling archive files

root #emerge --ask app-arch/p7zip

add rar support and install ark, an GUI archive manager

root #emerge --ask app-arch/rar
root #emerge --ask kde-apps/ark

to be able to read and identify non latin characters it is recommended to install the font meta package

root #emerge --ask media-fonts/fonts-meta

this should provide enough for a minimal modern desktop environment.

Setting up SDDM

Start by adding elogind to boot

root #rc-update add elogind boot

next, add the sddm user to the video group

root #usermod -a -G video sddm

continue to install a GUI configuration tool for plasma

root #emerge --ask kde-plasma/sddm-kcm

Going with wayland as a default it is possible to remove the other desktop session entries from SDDM. There are two folders that get parsed for .desktop configuration files /usr/share/wayland-sessions for wayland and for X server: /usr/share/xsessions rename the files inside the xsessions folder

root #mv /usr/share/xsessions/plasma.desktop /usr/share/xsessions/plasma.desktop.DONT
root #mv /usr/share/xsessions/Xsession.desktop /usr/share/xsessions/Xsession.desktop.DONT

next install the display manager init for openRC

root #emerge --ask gui-libs/display-manager-init

configure it with

FILE /etc/conf.d/display-manager

add display manager init to default

Make sure your desktop environment actually works with dbus-launch --exit-with-session startplasma-wayland before doing this. You might get stuck with a black screen otherwise and be forced to power off. Running this while chrooted will leave the scope of this guide, do it while booted into the system. You might want to setup NetworkManager beforehand
root #rc-update add display-manager default

Changing to NetworkManager

Networkmanager got already pulled in by the profile. Add your user account to the group plugdev

root #gpasswd -a larry plugdev

proceed to disable every other network service even dhcpd

root #for x in /etc/runlevels/default/net.* ; do rc-update del $(basename $x) default ; rc-service --ifstarted $(basename $x) stop; done
root #rc-update del dhcpcd default

now that everything got disabled enable networkmanager

root #rc-update add NetworkManager default

continue to install a GUI for plasma

root #emerge --ask kde-plasma/plasma-nm

In order for Networkmanager to leave the hostname set in /etc/hostname alone the same hostname needs to also be defined in

FILE /etc/conf.d/hostname
# Hostname fallback if /etc/hostname does not exist

by default "localhost" is written here. Networkmanager will resolve that "address" and change your hostname to a reverse DNS entry provided by your ISP.

The system should now be ready to reboot into a fully functioning desktop environment. It is possible to continue onward for more basic applications.

Firejailing Firefox

After emerging Firefox with

root #emerge --ask www-client/firefox

it is recommended to isolate it from the system with firejail. First install it

root #emerge --ask sys-apps/firejail

On gentoo firejail comes with a lot pre configured profiles. Activate it for firefox systemwide by creating following symlink:

root #ln -s /usr/bin/firejail /usr/local/bin/firefox

Besides that the first task of each new Firefox install should be installing the Ublock Origin extension.
It is further recommended to firejail popular applications that make heavy use of web technology in their frontend. For example: Discord, Spotify and Steam.

Optional: Flatpak support

While not recommended it might be a good way to introduce heavy GUI reliant users to the terminal by giving them the option to browse and copy a command for fast and easy smartphone like application installation.
First install it

root #emerge --ask sys-apps/flatpak

switch to the user account and install the flathub repo

user $flatpak remote-add --user --if-not-exists flathub

It is further recommended to install flatseal to allow for GUI permission management

user $flatpak install com.github.tchx84.Flatseal

that user will now be able to install software by using the website and copying the install command for a chosen app. It will automatically be added to KDEs app launcher.
use the command

user $flatpak update

to update all installed apps and

user $flatpak uninstall <appIdentifier>

to remove installed apps again. This will allow a new user to gain confidence with a terminal without wielding the power to actually break something.