Difference between revisions of "Wayland (简体中文)"

From ArchWiki
Jump to navigation Jump to search
Line 230: Line 230:
  
 
== 窗口管理器和桌面 shell==
 
== 窗口管理器和桌面 shell==
 
+
{| class="wikitable"
===KDE===
+
! Name
[[KDE]] 4.11 增加了对 [http://blog.martin-graesslin.com/blog/2013/06/starting-a-full-kde-plasma-session-in-wayland/ Wayland 下的 KWin 系统的 compositor]. 现在还没有对用 KWin 作为作业 compositor 的支持.
+
! Type
 
+
! Description
=== GNOME ===
+
|-
{{警告| Gnome Wayland session 必须要在安装了 {{pkg|xorg-server-xwayland}} 之后才能运行}}
+
| GNOME
在3.14或更高版本, [[GNOME]] 支持在 Wayland 运行。Gnome compositor可以在没有X的情况下运行并且会作为Wayland 系统 compositor。它被认为可以稳定使用,但仍有一些功能不支持(请参阅Gnome文档)。在此桌面下,用X运行的软件会用 Wayland 运行。
+
| Compositing
 
+
| 参见 [[GNOME#Starting GNOME]].
要开始使用 Gnome on Wayland,则应当使用GDM,并且用户应当在登陆前选择"Gnome on Wayland"。
+
|-
 
+
| Hawaii
=== Hawaii ===
+
| ''(Unclear)''
 
+
| 参见 [[Hawaii]].
详见 [[Hawaii]].
+
|-
 
+
| sway
=== i3 ===
+
| Tiling
 
+
| [https://github.com/SirCmpwn/sway Sway] is an i3-compatible window manager for Wayland.
一些 [[i3]] 的开发者计划启动 [http://www.i3way.org/ 一个完整的项目] 从而实现一个 Weston 下的 shell 工具来执行 i3 的同样特点。
+
|-
 
+
| KDE
=== [[Loliwm]] ===
+
| Compositing
 
+
| [[KDE]] 4.11 added support for [http://blog.martin-graesslin.com/blog/2013/06/starting-a-full-kde-plasma-session-in-wayland/ KWin under Wayland system compositor]. Since KDE 5.3 [https://community.kde.org/KWin/Wayland/ KWin is also able to be run nested] and can start an Xwayland server to support X11 clients under Wayland. Support for Wayland clients is planned for KDE 5.4.
[https://github.com/Cloudef/loliwm loliwm] is a tiling WM for Wayland.
+
|-
 
+
| Orbment
=== [[Velox]] ===
+
| Tiling
 
+
| [https://github.com/Cloudef/orbment orbment] (previously loliwm) is a tiling WM for Wayland.
[https://github.com/michaelforney/velox velox] 是一个基于 [[swc]] 的简单窗口管理器。这是接受 [[dwm]] [[xmonad]] 的官方授意的。
+
|-
 
+
| Velox
=== [[Orbital]] ===
+
| Tiling
 
+
| [https://github.com/michaelforney/velox velox] is a simple window manager based on swc. It is inspired by [[dwm]] and [[xmonad]].
[https://github.com/giucam/orbital Orbital] is a Wayland compositor and shell, using Qt5 and Weston. The goal of the project is to build a simple yet flexible and good looking Wayland desktop. It is not a full fledged DE but rather the analogue of a WM in the X11 world, such as [[Awesome]] or [[Fluxbox]].
+
|-
 
+
| Orbital
=== [[Papyros Shell]] ===
+
| Compositing
 
+
| [https://github.com/giucam/orbital Orbital] is a Wayland compositor and shell, using Qt5 and Weston. The goal of the project is to build a simple yet flexible and good looking Wayland desktop. It is not a full fledged DE but rather the analogue of a WM in the X11 world, such as [[Awesome]] or [[Fluxbox]].
[https://github.com/papyros/papyros-shell Papyros Shell] is the desktop shell for [http://papyros.io Papyros], built using QtQuick and QtCompositor as a compositor for Wayland.
+
|-
 
+
| Papyros Shell
=== [[Maynard]] ===
+
| ''(Unclear)''
 
+
| [https://github.com/papyros/papyros-shell Papyros Shell] is the desktop shell for [http://papyros.io Papyros], built using QtQuick and QtCompositor as a compositor for Wayland.
[https://github.com/raspberrypi/maynard Maynard] is a desktop shell client for Weston based on GTK. It was based on weston-gtk-shell, a project by Tiago Vignatti.
+
|-
 
+
| Maynard
=== [[Motorcar]] ===
+
| ''(Unclear)''
 
+
| [https://github.com/raspberrypi/maynard Maynard] is a desktop shell client for Weston based on GTK. It was based on weston-gtk-shell, a project by Tiago Vignatti.
[https://github.com/evil0sheep/motorcar Motorcar] is a wayland compositor to explore 3D windowing.
+
|-
 +
| Motorcar
 +
| ''(Unclear)''
 +
| [https://github.com/evil0sheep/motorcar Motorcar] is a wayland compositor to explore 3D windowing.
 +
|}
  
 
==问题解决==
 
==问题解决==

Revision as of 08:32, 18 August 2015

翻译状态: 本文是英文页面 Wayland翻译,最后翻译时间:2013-03-30,点击这里可以查看翻译后英文页面的改动。

Wayland 是 Linux 的一个新的图形接口协议,目的是替代有 25 年历史的 X11 Server。使用 Wayland 需要更改或重新安装一部分系统中的软件。更多关于 Wayland 的信息参见 主页

警告: Wayland仍处于开发阶段,某些功能可能不完整

系统需求

目前 Wayland 只能在使用了 KMS 的系统上工作。

安装

注意: Wayland 应该已经作为gtk2gtk3的依赖安装到系统里面

如果没有,可以从 官方软件仓库 安装软件包wayland

使用

Wayland 仅仅是一个库,无法单独工作。因此使用 Wayland 需要有混合程序(weston), Weston 演示程序、Qt5 加 Wayland 插件,还可以选择使用有 Wayland 支持的 GTK+ 库。

Weston

安装

从 community 安装 weston

使用

安装完了 Wayland 及它所依赖的包之后,就可以开始试用了。切换到终端,运行:

 $ weston-launch
Note: 要运行 Westron,用户必须属于 video 组;不要以 root 执行此命令,否则 VT 可能冻结。
Note: If you get an LLVM assertion failure, you need to rebuild mesa without Gallium LLVM until this problem is fixed. This may imply disabling some drivers which require LLVM.

如果 nouveau 驱动有问题,可以尝试运行:

 $ export EGL_DRIVER=/usr/lib/egl/egl_gallium.so

可以在 X 会话中运行 Weston:

$ weston

接下来你就可以在 TTY 下打开 wayland 的终端:

$ weston-terminal

在屏幕上移动一朵花儿,用以测试帧控制功能:

$ weston-flower 

在 Wayland 上运行 glxgears 程序:

$ weston-gears 

显示图片:

$ weston-image image1.jpg image2.jpg...

显示 PDF 文件:

$ weston-view doc1.pdf doc2.pdf...

配置

键盘布局,模块的选择,UI的修改的示例配置文件,请参阅man weston.ini

~/.config/weston.ini
[core]
### uncomment this line for xwayland support ###
#modules=xwayland.so

[shell]
background-image=/usr/share/backgrounds/gnome/Aqua.jpg
background-color=0xff002244
panel-color=0x90ff0000
locking=true
animation=zoom
#binding-modifier=ctrl
#num-workspaces=6
### for cursor themes install xcursor-themes pkg from Extra. ###
#cursor-theme=whiteglass
#cursor-size=24

### tablet options ###
#lockscreen-icon=/usr/share/icons/gnome/256x256/actions/lock.png
#lockscreen=/usr/share/backgrounds/gnome/Garden.jpg
#homescreen=/usr/share/backgrounds/gnome/Blinds.jpg
#animation=fade

[keyboard]
keymap_rules=evdev
#keymap_layout=gb
#keymap_options=caps:ctrl_modifier,shift:both_capslock_cancel
### keymap_options from /usr/share/X11/xkb/rules/base.lst ###


[terminal]
#font=DroidSansMono
#font-size=14



[launcher]
icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png
path=/usr/bin/gnome-terminal

[launcher]
icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png
path=/usr/bin/weston-terminal

[launcher]
icon=/usr/share/icons/hicolor/24x24/apps/firefox.png
path=/usr/bin/firefox

[launcher]
icon=/usr/share/icons/gnome/24x24/apps/arts.png
path=./clients/flower

[screensaver]
# Uncomment path to disable screensaver
path=/usr/libexec/weston-screensaver
duration=600

[input-method]
path=/usr/libexec/weston-keyboard

###  for Laptop displays  ###
#[output]
#name=LVDS1
#mode=1680x1050
#transform=90

#[output]
#name=VGA1
# The following sets the mode with a modeline, you can get modelines for your preffered resolutions using the cvt utility
#mode=173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
#transform=flipped

#[output]
#name=X1
#mode=1024x768
#transform=flipped-270

简单的 weston.ini :

~/.config/weston.ini
[core]
modules=xwayland.so

[keyboard]
keymap_layout=gb

[launcher]
icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png
path=/usr/bin/weston-terminal

[launcher]
icon=/usr/share/icons/hicolor/24x24/apps/firefox.png
path=/usr/bin/firefox


[output]
name=LVDS1
mode=1680x1050
transform=90

XWayland

你可以在官方的 extra 库中找到xorg-server-xwayland包.

When you want to run an X application from within Weston, it spins up Xwayland to service the request. The following configuration file is required:

~/.config/weston.ini
[core]
modules=xwayland.so

视频录制

Weston has build-in screencast recording which can be started and stopped by pressing the Super + R key combination. Screencasts are saved to the file capture.wcap in the current working directory of Weston.

The WCAP format is a lossless video format specific to Weston, which only records the difference in frames. To be able to play the recorded screencast, the WCAP file will need to be converted to a format which a media player can understand.

To convert the file to webm, execute:

$ wcap-decode capture.wcap --yuv4mpeg2 | vpxenc --target-bitrate=1024 --best -t 4 -o foo.webm -

To convert the file to ogv, execute:

$ wcap-decode capture.wcap --yuv4mpeg2 | theora_encode - -o cap.ogv

高DPI显示器

Use

~/.config/weston.ini

[output]
name=...
scale=2

for "retina" or "HiDPI" displays.

图形库

官方资料上查看详细信息

GTK+ 3

[extra]软件仓库中的gtk3 已经提供了 Wayland 支持.

GTK+ 3.0 开始,GTK+ 可以在运行时同时支持多个后端,和 Qt 一样进行切换。

Wayland 和 X 后端都启用时,GTK+ 默认会使用 X11。可以通过把GDK_BACKEND环境变量设为wayland来改变这一规则。

如果出现 segment faults,删除libcanberra。0.31.0 之后的版本已经修复了这个问题。 链接

Qt5

安装

AUR 安装 qt5-base-gitAUR,然后编译插件 qt5-wayland-gitAUR.

要使用 wayland 插件运行程序,需要将 QT_QPA_PLATFORM 环境变量设置为 waylandgl。

$ export QT_QPA_PLATFORM=waylandgl
$ ./binaryname

Clutter

Clutter 工具包有 Wayland 后端支持,可以作为 Wayland 程式运行。这一后端支持已经存在于开发主分支中main repo,可以以 --with-flavour=wayland来加以配置

SDL

Benjamin Franzke 将 SDL 移植到 Wayland 上, 可以从freedesktop.org sdl-wayland repo处获得。Andre Heider 接着 Benjamin Franzke 的工作进行开发,代码在libsdl 的 wayland 分支

GLFW

Experimental wayland support is now in GLFW 3.1 and can be enabled with a CMake option at compile time. You can also install the package glfw3-gitAUR from the AUR and add -DGLFW_USE_WAYLAND=ON to the CMake flags.


EFL

EFL 已经完全支持 Wayland。请参考这里获取更多细节。

窗口管理器和桌面 shell

Name Type Description
GNOME Compositing 参见 GNOME#Starting GNOME.
Hawaii (Unclear) 参见 Hawaii.
sway Tiling Sway is an i3-compatible window manager for Wayland.
KDE Compositing KDE 4.11 added support for KWin under Wayland system compositor. Since KDE 5.3 KWin is also able to be run nested and can start an Xwayland server to support X11 clients under Wayland. Support for Wayland clients is planned for KDE 5.4.
Orbment Tiling orbment (previously loliwm) is a tiling WM for Wayland.
Velox Tiling velox is a simple window manager based on swc. It is inspired by dwm and xmonad.
Orbital Compositing Orbital is a Wayland compositor and shell, using Qt5 and Weston. The goal of the project is to build a simple yet flexible and good looking Wayland desktop. It is not a full fledged DE but rather the analogue of a WM in the X11 world, such as Awesome or Fluxbox.
Papyros Shell (Unclear) Papyros Shell is the desktop shell for Papyros, built using QtQuick and QtCompositor as a compositor for Wayland.
Maynard (Unclear) Maynard is a desktop shell client for Weston based on GTK. It was based on weston-gtk-shell, a project by Tiago Vignatti.
Motorcar (Unclear) Motorcar is a wayland compositor to explore 3D windowing.

问题解决

更多信息

forum discussion 页面将持续关注 Wayland 信息 ,如有兴趣请留意。