KDE
KDE 是一个自由软件社区,其提供了一组应用程序,包括流行的 Plasma 桌面环境。
Gentoo对KDE项目的支持非常好,包括对KDE Frameworks 5,Plasma 5和Applications的全面支持,以及其他各种各样基于KDE的软件。
准备
配置
Read relevant documentation before performing any profile changes.
选择一个适当的Portage配置,尽管这不是必须的,但是我们仍建议这么做。因为这会设置一些全局或针对特定软件包的 USE 旗标来确保你能够获得顺畅的 KDE 使用体验。
为了选择适当的Portage配置,首先需要列出有哪些可用的Portage配置:
root #
eselect profile list
... [16] default/linux/amd64/17.1 (stable) [17] default/linux/amd64/17.1/selinux (stable) [18] default/linux/amd64/17.1/hardened (stable) [19] default/linux/amd64/17.1/hardened/selinux (stable) [20] default/linux/amd64/17.1/desktop (stable) [21] default/linux/amd64/17.1/desktop/gnome (stable) [22] default/linux/amd64/17.1/desktop/gnome/systemd (stable) [23] default/linux/amd64/17.1/desktop/plasma (stable) [24] default/linux/amd64/17.1/desktop/plasma/systemd (stable) ...
然后选择正确的Portage配置,把下面的命令中的X
替换为合适的Portage配置对应的数字:
root #
eselect profile set X
如果要使用 Plasma 5 桌面环境,请选择desktop/plasma
OpenRC或者desktop/plasma/systemd
systemd/zh-cn。需要注意的是,技术上可能可以实现除配置文件的其他USE标志组合(特别是在运行选定的应用程序而不是完整的KDE Plasma桌面环境时),但可能不受支持,未经测试,也可能导致意外的功能丢失。
服务
在接下来的章节里,按着安装步骤,这些服务将会默认自动选上,具体的取决于之前选择的profile。但在第一次启动KDE Plasma之前,还是需要将它们设置妥当。为了不会使用默认设置,建议在安装KDE Plasma或者KDE应用程序之前,通过emerge ‑‑oneshot
先安装这些服务,以便Portage将它们考虑进去。点按链接获取有关如何设置这些服务的信息。
会话管理器
从下列中只选一个:
- elogind: 从systemd项目中提取的单独的logind服务包,用于OpenRC或其他初始化系统。
- systemd: 使用systemd提供的会话管理器,systemd用户不需要为此做更多的工作。
设备管理器
从下列中只选一个:
- udev: 启用对udev Linux动态和固定设备命名的支持。
- eudev: udev的分支,可更好地与旧内核和各种工具链兼容。
- systemd: 使用systemd提供的设备管理器,systemd用户不需要为此做更多的工作。
杂项
X 服务
阅读下列来自 X server 的介绍来设置 X 环境。
Plasma
Plasma 5 是 KDE 正在发展的一代桌面环境,基于 Qt 5 和 KDE Framework 5 。
可用版本
KDE | Gentoo | Ebuild repository | Status |
---|---|---|---|
KDE Plasma 5.24.4 | kde-plasma/plasma-meta-5.24.4 | gentoo | Stable for amd64, arm64, and x86; testing for arm, ppc64, and riscv |
KDE Plasma 5.24.5 | kde-plasma/plasma-meta-5.24.5 | gentoo | Stable for amd64, arm64, and x86; testing for arm, ppc64, and riscv |
KDE Plasma 5.24 stable branch | kde-plasma/plasma-meta-5.24.49.9999 | KDE | Live version |
KDE Plasma 5.25 stable branch | kde-plasma/plasma-meta-5.25.49.9999 | KDE | Live version |
KDE Plasma master branch | kde-plasma/plasma-meta-9999 | KDE | Live version |
在继续安装之前,请确保选择了一个 Plasma 的Portage配置。
安装
kde-plasma/plasma-meta 包提供完整的 Plasma 5 桌面,可通过丰富的 USE 旗标配置:
USE flags for kde-plasma/plasma-meta Merge this to pull in all Plasma 5 packages
accessibility
|
Add support for accessibility (eg 'at-spi' library) |
bluetooth
|
Enable Bluetooth Support |
browser-integration
|
Enable integration with Chrome/Firefox with browser extensions |
colord
|
Enable kde-plasma/kwin color management via x11-misc/colord |
crash-handler
|
Pull in kde-plasma/drkonqi for assisted upstream crash reports |
crypt
|
Pull in kde-plasma/plasma-vault for encrypted vaults integration |
desktop-portal
|
Enable sys-apps/xdg-desktop-portal backend implementation for Plasma |
discover
|
Pull in resources management GUI; a centralised GHNS alternative and optional sys-apps/fwupd frontend |
display-manager
|
Pull in a graphical display manager |
elogind
|
Enable session tracking via sys-auth/elogind |
firewall
|
Pull in kde-plasma/plasma-firewall for system firewall administration |
grub
|
Pull in Breeze theme for sys-boot/grub |
gtk
|
Enable Breeze widget style and system settings module for GTK+ |
handbook
|
Enable handbooks generation for packages by KDE |
kwallet
|
Enable support for KWallet auto-unlocking via kde-plasma/kwallet-pam |
legacy-systray
|
Add support for legacy applications using kde-plasma/xembed-sni-proxy |
networkmanager
|
Enable net-misc/networkmanager support |
plymouth
|
Pull in Breeze theme for sys-boot/plymouth |
pulseaudio
|
Install Plasma applet for PulseAudio volume management |
sddm
|
Pull in the x11-misc/sddm display manager and system settings module |
sdk
|
Pull in kde-plasma/plasma-sdk for Plasma development |
smart
|
Pull in kde-plasma/plasma-disks for disk health monitoring |
systemd
|
Enable use of systemd-specific libraries and features like socket activation or session tracking |
thunderbolt
|
Pull in kde-plasma/plasma-thunderbolt control center module |
wallpapers
|
Install wallpapers for the Plasma Workspace |
root #
emerge --ask kde-plasma/plasma-meta
你也可以选择安装 kde-plasma/plasma-desktop,它提供了一个非常基本的桌面,让用户可以自由安装他们需要的额外软件包 - 或者更确切地说,让他们自己找出并补全缺少的功能。
请注意,仅安装kde-plasma/plasma-desktop会丢失重要的软件包,例如kde-plasma/powerdevil(电源管理,挂起和休眠选项),kde-plasma/systemsettings等等,在这种情况下都不会被支持。
显示管理器
SDDM (Simple Desktop Display Manager) 是被推荐的登录管理器并且它默认会通过 kde-plasma/plasma-meta 被自动安装。 另外你也可以选择使用 LightDM ,这需要为 kde-plasma/plasma-meta 设置 -sddm
的 USE 旗标, 同时还要修改 /etc/conf.d/xdm 中的设置。 同时在发生错误时请阅读 SDDM 页面。
无显示管理器
Plasma 可以用startx以老式方式启动,但需要格外小心以确保它获得有效的会话。
~/.xinitrc
Using elogind or systemd#!/bin/sh exec dbus-launch --exit-with-session startplasma-x11
When using Wayland, Plasma can be launched with dbus-launch --exit-with-session startplasma-wayland
This can be added to a user's profile file which will be executed when logging in:
~/.profile
#!/bin/sh dbus-launch --exit-with-session startplasma-wayland
小工具
kde-plasma/kdeplasma-addons 提供了很多有用的小工具 (早就被 kde-plasma/plasma-meta作为依赖安装了):
root #
emerge --ask kde-plasma/kdeplasma-addons
系统托盘
Plasma 5 对系统托盘图标使用StatusNotifier规范 [1]。由于并非所有应用程序都已移植到新系统,因此需要一些应变方法 [2],并且 Plasma 5 也具有将旧的基于xembed的系统托盘图标转换为StatusNotifier图标的方法。
通过激活kde-plasma/plasma-meta的 legacy-systray
来启用传统支持,这将引入kde-plasma/xembed-sni-proxy。
/etc/portage/package.use/kde-plasma-settings
Change USE flags for kde-plasma/plasma-meta# xembed system tray support for legacy applications kde-plasma/plasma-meta legacy-systray
Pidgin
net-im/pidgin 需要 x11-plugins/pidgin-indicator。安装完成后,在 工具|插件 下可以找到 Ubuntu 指示器 插件。
KWallet
在登录桌面后添加一个(无线)网络连接或者在kde-apps/kmail中添加一个电子邮箱账户时,许多用户被推荐使用 kde-frameworks/kwallet —— Plasma桌面的加密密码存储器。
有个软件包kde-apps/kwalletmanager,可用于管理KWallets,导入及导出密码:
root #
emerge --ask kde-apps/kwalletmanager
KWallet 自动解锁
kde-plasma/kwallet-pam 提供了一种机制,可以避免在登录后即被要求访问kwallet。
root #
emerge --ask kde-plasma/kwallet-pam
需要如下的配置:
- 为了KWallet的安全性,请使用比较传统的blowfish加密,而不是GPG
- 在kwallet和用户使用相同的密码
- 让登录管理器支持PAM特性 - x11-misc/sddm 和 x11-misc/lightdm 都支持
/etc/pam.d/sddm
Config lines for KWallet PAM unlocking via SDDM-auth optional pam_kwallet5.so -session optional pam_kwallet5.so auto_start
对于LightDM, 需要自己编辑/etc/pam.d/lightdm
如果在登录时,存有你的用户的KWallet文件的文件系统已经被pam_mount挂载,你可能需要将~/.local/share/kwalletd/kdewallet.salt复制到你的根文件系统的相同路径下。否则,PAM会在主目录可用之前尝试解锁KWallet并失败。实际包含加密的KWallet密码的文件~/.local/share/kwalletd/kdewallet.kwl不需要复制。
禁用 KWallet
要完全禁用KWallet子系统,请编辑以下文件:
~/.config/kwalletrc
[Wallet] Enabled=false
SSH/GPG 密钥启动/关闭脚本
ssh-agent 脚本位于 /etc/xdg/plasma-workspace/env
和 /etc/xdg/plasma-workspace/shutdown。关闭脚本需要设置可执行位,因为它们不是源。Keychain 提供了更多信息
Non-root user authentication for dialogs
Some KDE dialogs such as printers, adding wireless networks and adding users require administrator authentication. This is handled through sys-auth/polkit and operates independently from app-admin/sudo. By default in Gentoo, the root account is the only administrator, and so even if a user account can run root commands through sudo, authentication in these KDE dialogs will fail.
Adding wireless networks using net-misc/networkmanager is allowed by a polkit rule which is part of the Gentoo package and already allows access for every user in the group plugdev. For other dialogs you need to configure the behavior manually: If you would like all users of the group wheel to be administrators, create a copy of /etc/polkit-1/rules.d/50-default.rules starting with a number lower than 50, and edit the line return ["unix-user:0"] to the following:
/etc/polkit-1/rules.d/49-wheel.rules
Administrator wheel grouppolkit.addAdminRule(function(action, subject) { return ["unix-group:wheel"]; });
The Polkit wiki page provides more details on rules configuration.
使用root权限运行 GUI 应用
使用root权限启动 GUI 应用可能是一个 非常 坏的主意。相比之下,更好的办法是将常规用户添加到相应的组或者只是无提权地运行命令。只有在绝对必要时才使用 kdesu 。
KDE Plasma有一个实用程序,用于以root权限启动图形应用。它由kde-plasma/kde-cli-tools提供 - 要使用 USE 标志kdesu
构建。这将会安装kde-frameworks/kdesu的一个图形前端。这依赖Xorg,并且仅在X内有效。
/etc/portage/package.use/kde-plasma-settings
Change USE flags for kde-plasma/kde-cli-tools# 为kde-frameworks/kdesu构建图形前端(需要X) kde-plasma/kde-cli-tools kdesu X
记得要重建软件包以获取更改:
root #
emerge -1 kde-cli-tools
可以通过从KRunner或终端仿真器调用kdesu来使用它:
user $
kdesu <program-name>
将显示一个消息对话框,提示输入root密码。
出于安全原因,某些应用(如kwrite、dolphin等)拒绝使用kdesu打开。
By default, kdesu internally uses su, which may not be preferred for some use cases. It is possible to use sudo or other sudo-compatible commands, by changing kdesurc:
$XDG_CONFIG_HOME/kdesurc
Use sudo instead of su in kdesu[super-user-command] super-user-command=sudo
Files
KDE uses XDG standard directories to it's configuration for Plasma and it's applications:
- $XDG_CONFIG_HOME (defaults to $HOME/.config) - Configuration files of Plasma and KDE apps.
- $XDG_DATA_HOME (defaults to $HOME/.local/share) - App data of Plasma and KDE apps.
Removal
Uninstall all packages
A possible way to completely remove Plasma by explicitly the kde-plasma/plasma-meta package and all software depending on it:
root #
emerge --ask --depclean --verbose kde-plasma/plasma-meta
This will not just remove Plasma but also all other packages depending on it (unconditionally or through a USE flag dependency), such as e.g. plasma-pass[kde].
Clean up Portage definitions
Look in /etc/portage for any KDE/Plasma specific settings in package.mask, package.unmask, package.keywords and package.accept_keywords and clean up any definitions referring to Plasma packages.
Remove unneeded dependencies
After uninstalling any Plasma packages, make sure to ask Portage to uninstall any leftover dependencies:
root #
emerge --ask --depclean
应用程序(Applications)
发行版本包含很多基于 Qt 5/KDE Frameworks 5 的应用程序和支持库。
可用版本
KDE | Gentoo | Ebuild repository | Status |
---|---|---|---|
KDE Gear 21.12.3 | kde-apps/kde-apps-meta-21.12.3 | gentoo | Stable for amd64, arm64, and x86; testing for ppc64 |
KDE Gear 22.04.1 | kde-apps/kde-apps-meta-22.04.1 | gentoo | Testing for amd64, arm64, ppc64, and x86 |
KDE Gear 22.04 stable branch | kde-apps/kde-apps-meta-22.04.49.9999 | KDE | Live version |
KDE Gear master branch | kde-apps/kde-apps-meta-9999 | KDE | Live version |
KDE Applications这个包会安装以下包:
Package name | Description |
---|---|
kde-apps/kdeaccessibility-meta | “无障碍”程序和工具。 |
kde-apps/kdeadmin-meta | 管理工具,用以管理系统。 |
kde-apps/kdecore-meta | 基本的应用,比如文件管理器,编辑器,终端模拟器。 |
kde-apps/kdeedu-meta | 教育用程序和游戏。 |
kde-apps/kdegames-meta | 基本的桌面游戏 |
kde-apps/kdegraphics-meta | 图形方面的程序,例如图片查看器,取色器等等。 |
kde-apps/kdemultimedia-meta | 多媒体程序和服务。 |
kde-apps/kdenetwork-meta | 网络相关的程序和 VNC 服务。 |
kde-apps/kdepim-meta | 个人信息管理程序比如电子邮件客户端,组织,通讯录等等。 |
kde-apps/kdesdk-meta | 一些开发工具 |
kde-apps/kdeutils-meta | 基本的桌面工具,比如归档管理器,计算器等等。 |
安装
kde-apps/kde-apps-meta 包提供完整的应用程序集合,但是可替代地,可以挑选来自上述列表的一个或多个较小的元包:
root #
emerge --ask kde-apps/kde-apps-meta
本地化
Plasma-5 和应用程序的每个包都提供了本地化文件。可以在系统设置中启用本地化。
KDE PIM
KDE PIM 是一整套用于管理个人信息的应用程序,包括邮件,日历,联系人等。它有几个可选的运行时依赖来扩展其功能:
框架(Frameworks)
KDE Frameworks 5 是一套运行库和软件框架的合集,为KDE Plasma 5 和 KDE 应用提供基础,但是可能会受到一些 Qt 程序的影响。
KDE 框架大部分是运行库,只提供少量的面对用户的功能。它不需要被手动安装 —— 需要的软件包会被作为别的软件包的依赖自动安装。
可用版本
KDE | Gentoo | Ebuild repository | Status |
---|---|---|---|
KDE Frameworks 5.92.0 | kde-frameworks/*-5.92.0 | gentoo | Stable for amd64, arm64, and x86; testing for arm, ppc64, and riscv |
KDE Frameworks 5.94.0 | kde-frameworks/*-5.94.0 | gentoo | Testing for amd64, arm, arm64, ppc64, riscv, and x86 |
KDE Frameworks master branch | kde-frameworks/*-9999 | KDE | Live version |
更多KDE软件
最主要的 KDE 应用程序在 Porage 树的 kde-apps 和kde-misc 分类中。
故障排除
请参阅 故障排除 子文章。
另请参阅
- 从Plasma 4升级到5 - 有关如何从Plasma 4升级、迁移和故障排除的信息。
- KDE/Ebuild repository — provides instructions on adding Gentoo's KDE ebuild development repository to a system.
- kde-sunset ebuild仓库 - 包含已从主ebuild仓库中删除的旧KDE软件。