KDE

From Gentoo Wiki
Jump to: navigation, search
This page is a translated version of the page KDE and the translation is 72% complete.

Outdated translations are marked like this.
Other languages:
Deutsch • ‎English • ‎Türkçe • ‎español • ‎français • ‎italiano • ‎polski • ‎português do Brasil • ‎русский • ‎українська • ‎中文(中国大陆)‎ • ‎日本語 • ‎한국어
Resources

KDE 是自由软件社区,提供的一组应用程序,包括流行的 Plasma 桌面环境。

Gentoo对KDE项目的支持非常好,包括对KDE Frameworks 5,Plasma 5和Applications的全面支持,以及其他各种各样基于KDE的软件。

准备

配置

选择一个适当的Portage配置,尽管这不是必须的,但是我们仍建议这么做。因为这会设置一些全局或针对特定软件包的 USE 旗标来确保你能够获得顺畅的 KDE 使用体验。

为了选择适当的Portage配置,首先需要列出有哪些可用的Portage配置

root #eselect profile list
  ...
  [12]  default/linux/amd64/17.0 (stable)
  [13]  default/linux/amd64/17.0/selinux (stable)
  [14]  default/linux/amd64/17.0/hardened (stable)
  [15]  default/linux/amd64/17.0/hardened/selinux (stable)
  [16]  default/linux/amd64/17.0/desktop (stable)
  [17]  default/linux/amd64/17.0/desktop/gnome (stable)
  [18]  default/linux/amd64/17.0/desktop/gnome/systemd (stable)
  [19]  default/linux/amd64/17.0/desktop/plasma (stable)
  [20]  default/linux/amd64/17.0/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桌面环境时),但可能不受支持,未经测试,也可能导致意外的功能丢失。

服务

在安装 KDE 软件之前,建议先设置并启用几个别的服务。它们当中的一部分已经由 desktop/plasmadesktopPortage配置设定好了。这些服务是:

  • D-Bus: 启用 D-Bus 信息总线系统(D-Bus message bus system)。
  • polkit: 启用 polkit 框架以控制系统中的服务的权限。
  • udev: 启用对 udev —— Linux 下的动态的、常驻后台的自动为设备命名的服务(dynamic and persistent device naming service) ——的支持。
  • udisks: 启用一些与存储相关的服务。

Session tracker

Choose exactly one of:

  • elogind: Standalone logind package extracted from systemd project for use with OpenRC or other init systems.
  • systemd: Uses the session tracker part of systemd. Users of systemd do not need to take any other initiative here.
  • consolekit: Framework for defining and tracking users, login sessions, and seats. It is currently default for the desktop/plasma profile.

For Wayland support, a logind implementation is required. Gentoo provides elogind as an alternative to systemd.

Device manager

Choose exactly one of:

  • eudev: Gentoo's fork of udev with the goal of obtaining better compatibility. It is the default for the desktop/plasma profile.
  • udev: Enables support for udev Linux dynamic and persistent device naming.
  • systemd: Uses the device manager part of systemd. Users of systemd do not need to take any other initiative here.

Miscellaneous

  • D-Bus: Enables use of the D-Bus message bus system.
  • polkit: Enables the polkit framework for controlling privileges for system-wide services.
  • udisks: Enables support for some storage related services.

X 服务

阅读下列来自 X server 的介绍来设置 X 环境。

Package conflicts

KDE Plasma and Applications come with many dependencies. Some of these dependencies will predetermine package choices where otherwise there would be options to choose from.

Plasma

Plasma 5 是 KDE 正在发展的一代桌面环境,基于 Qt 5 和 KDE Framework 5 。

可用版本

KDE Gentoo Ebuild repository Status
KDE Plasma 5.14.3 kde-plasma/plasma-meta-5.14.3 gentoo Stable for amd64 and x86; Testing for arm and arm64
KDE Plasma 5.14.5 kde-plasma/plasma-meta-5.14.5 gentoo Testing for amd64, arm, arm64 and x86
KDE Plasma master branch kde-plasma/plasma-meta-9999 KDE Live version
附注
在继续安装之前,请确保选择了一个 Plasma 的Portage配置。 KDE 4 用户则需要一些额外的步骤。

安装

kde-plasma/plasma-meta 包提供完整的 Plasma 5 套件,由以下 USE 旗标配置:

USE flags for kde-plasma/plasma-meta Merge this to pull in all Plasma 5 packages

browser-integration Enable integration with Chrome/Firefox with browser extensions
consolekit Enable sys-auth/consolekit support instead of logind session tracking
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 Use sys-auth/elogind for session tracking
grub Pull in Breeze theme for sys-boot/grub
gtk Enable Breeze widget style and KCM for GTK2 and GTK3
handbook Enable handbooks generation for packages by KDE
legacy-systray Add support for legacy applications using kde-plasma/xembed-sni-proxy
networkmanager Enable net-misc/networkmanager support
pam Enable support for kwallet auto-unlocking
plymouth Pull in Breeze theme for sys-boot/plymouth
pm-utils Enable support for suspend/resume with sys-power/pm-utils when using sys-auth/consolekit
pulseaudio Install Plasma applet for PulseAudio volume management
sddm Pull in the x11-misc/sddm display manager and KCM
sdk Pull in kde-plasma/plasma-sdk for Plasma development
wallpapers Install wallpapers for the Plasma Workspace

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

你也可以选择通过安装 kde-plasma/plasma-desktop 获得一个基本的桌面环境,让你用户自己安装需要的软件:

root #emerge --ask kde-plasma/plasma-desktop
附注
请注意这样的安装方式会导致一些重要的包缺失,比如 kde-plasma/powerdevil (电源管理,睡眠和休眠选项)和 kde-plasma/systemsettings ,如果你用了上面这种方式请手动安装这两个软件包。

By default the classic tree view of kde-plasma/systemsettings is not enabled. The following USE flag will enable it:

FILE /etc/portage/package.use/systemsettingsEnable classic tree view
kde-plasma/systemsettings classic

Recompile systemsettings with new USE flags:

root #emerge --ask --changed-use kde-plasma/systemsettings

小工具

kde-plasma/kdeplasma-addons 提供了很多有用的小工具 (早就被 kde-plasma/plasma-meta作为依赖安装了):

root #emerge --ask kde-plasma/kdeplasma-addons

显示管理器

SDDM (Simple Desktop Display Manager) 是被推荐的登录管理器并且它默认会通过 kde-plasma/plasma-meta 被自动安装。 另外你也可以选择使用 LightDM ,这需要为 kde-plasma/plasma-meta 设置 -sddm 的 USE 旗标, 同时还要修改 /etc/conf.d/xdm 中的设置。 同时在发生错误时请阅读 SDDM 页面。

SDDM does not yet support multiseat, while LightDM does.

No display manager

Plasma can be started the old-fashioned way with startx, but extra care needs to be taken to ensure it gets a valid session. The following solution is limited to ConsoleKit:

FILE ~/.xinitrc
#!/bin/sh
exec ck-launch-session dbus-launch --sh-syntax --exit-with-session startkde

System tray

Plasma 5 uses the StatusNotifier specification for systray icons [1]. As not all applications have been ported to the new system, some workarounds exist [2], and Plasma 5 has a means to convert old xembed-based system tray icons to StatusNotifier icons.

Legacy support is enabled by activating legacy-systray for kde-plasma/plasma-meta, which is pulling in kde-plasma/xembed-sni-proxy.

root #echo "kde-plasma/plasma-meta legacy-systray" >> /etc/portage/package.use/plasma-systray

Pidgin

net-im/pidgin requires x11-plugins/pidgin-indicator. After install, the Ubuntu Indicator plugin can be found under Tools | Plugins.

KWallet

许多用户被推荐使用 kde-frameworks/kwallet, Plasma桌面的密码管理器, 再你登录桌面后连接(无线)网络。 在现在的很多发行版上还有第二个KWallet服务 - kde-apps/kwalletd 为基于kdelibs4的程序提供相同的储存密码功能。 kde-plasma/kwallet-pam 提供了避免用户在登录后需要再次输入密码访问kwallet的功能。

对于管理kwallet,导入或导出密码,这里有个kde-apps/kwalletmanager

root #emerge --ask kde-apps/kwalletmanager

KWallet 自动解锁

kde-plasma/kwallet-pam provides a mechanism to avoid being subsequently asked for access to kwallet after login.

root #emerge --ask kde-plasma/kwallet-pam

需要如下的配置:

  • 为了KWallet的安全性,请使用比较传统的blowfish加密,而不是GPG
  • 在kwallet和用户使用相同的密码
  • 让登录管理器支持PAM特性 - x11-misc/sddmx11-misc/lightdm 都支持
FILE /etc/pam.d/sddmAdding lines for KWallet PAM unlocking via SDDM
-auth           optional        pam_kwallet5.so
-session        optional        pam_kwallet5.so auto_start
# 下面两行也会解锁基于kdelibs4的程序
-auth           optional        pam_kwallet.so kdehome=.kde4
-session        optional        pam_kwallet.so
Note
对于LightDM, 需要自己编辑/etc/pam.d/lightdm

Disabling KWallet

To disable the KWallet subsystem completely, edit the following file:

FILE ~/.config/kwalletrc
[Wallet]
Enabled=false

SSH/GPG 密钥启动/关闭脚本

ssh-agent 脚本位于 /etc/plasma/startup/etc/plasma/shutdownKeychain 提供了更多信息

Run GUI applications with root privileges

Warning
It could be a very bad idea to start GUI applications with root privileges, versus adding the regular user to the relevant group or simply just running the command unprivileged. Only use kdesu when absolutely necessary.

KDE Plasma has a utility in order to start graphical programs with root privileges. It is provided by kde-plasma/kde-cli-tools - if built with USE flag kdesu, a graphical frontend to kde-frameworks/kdesu is installed, which can be used by invoking kdesu. This can be done either from KRunner or a terminal emulator:

user $kdesu <program-name>

A message dialog will be displayed prompting for the root password.

Note
Some applications such as kwrite, dolphin etc. refuse to be opened with kdesu for security reasons.

应用程序(Applications)

与很多基于 Qt 5/KDE Frameworks 5 和/或 基于 Qt 4/KDElibs 4 的应用程序和支持库一起发布(而后者依旧处于长期服务模式)。在Portage 树当中,使用slots 45 来区分。 上游正在进行从 KDE 4 到 5 的迁移,这可以从每次主要版本更新当中看出。这之中即有已经成熟的 Plasma 5 程序,也有新迁移过来的程序。注意,这同时意味着大版本更新时可能会造成依赖的冲突。当两个不同的软件包依赖于 slot 4 和 5 的相同库的时候将无法被安装:无法同时安装的相同库 - 此类包从* -meta中删除。

可用版本

KDE Gentoo Ebuild repository Status
KDE Applications 18.08.3 kde-apps/kde-apps-meta-18.08.3 gentoo Stable for amd64 and x86
KDE Applications 18.12.1 kde-apps/kde-apps-meta-18.12.1 gentoo Testing for amd64 and x86
KDE Applications 18.12 stable branch kde-apps/kde-apps-meta-18.12.49.9999 KDE Live version
KDE Applications 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/kdewebdev-meta 网络开发工具。

安装

kde-apps/kde-apps-meta 包提供完整的应用程序集合,但是可替代地,可以挑选来自上述列表的一个或多个较小的元包:

root #emerge --ask kde-apps/kde-apps-meta

本地化

Plasma-5 and Applications are shipping their localization per-package. Enable your localization in systemsettings.

KDE PIM

KDE PIM is a whole suite of applications to manage personal information including mail, calendar, contacts and more. It has several optional runtime dependencies to extend its functionality:

框架(Frameworks)

KDE Frameworks 5 是为KDE Plasma 5 和 KDE Applications 5 的运行库和软件框架的合集,但是可能会受到一些 Qt 程序的影响。

KDE 框架大部分是运行库,只提供少量的面对用户的功能。它不需要被手动安装 —— 需要的软件包会被作为别的软件包的依赖自动安装。

可用版本

KDE Gentoo Ebuild repository Status
KDE Frameworks 5.52.0 kde-frameworks/*-5.52.0 gentoo Stable for amd64 and x86, Testing for arm
KDE Frameworks 5.54.0 kde-frameworks/*-5.54.0 gentoo Testing for amd64, arm and x86
KDE Frameworks master branch kde-frameworks/*-9999 KDE Live version

更多KDE软件

最主要的 KDE 应用程序在 Porage 树的 kde-appskde-misc 分类中。

Troubleshooting

Refer to the Troubleshooting sub-article.

另请参阅

外部资源

References