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

From ArchWiki
Jump to navigation Jump to search
(update translation)
(flagged broken section links, simplification and beautification of wikilinks (interactive))
(Tag: wiki-scripts)
 
(36 intermediate revisions by 8 users not shown)
Line 1: Line 1:
[[Category:X Server (简体中文)]]
+
[[Category:X server (简体中文)]]
 
[[en:Wayland]]
 
[[en:Wayland]]
{{Article summary start|摘要}}
+
[[es:Wayland]]
{{Article summary text|关于安装和运行 Wayland 显示服务器的指南。}}
+
[[fr:Wayland]]
{{Article summary heading|相关页面}}
+
[[ja:Wayland]]
{{Article summary wiki|Kernel Mode Setting (简体中文)}}
+
[[ru:Wayland]]
{{Article summary wiki|Xorg (简体中文)}}
+
{{Related articles start (简体中文)}}
{{Article summary end}}
+
{{Related|Kernel Mode Setting (简体中文)}}
{{TranslationStatus (简体中文)|Wayland|2013-03-07|249323}}
+
{{Related2|Xorg (简体中文)|Xorg}}
'''Wayland''' 是 Linux 的一个新的图形接口协议,目的是替代有 25 年历史的 X11 Server。使用 Wayland 需要更改或重新安装一部分系统中的软件。更多关于 Wayland 的信息参见 [http://wayland.freedesktop.org/ 主页]。
+
{{Related articles end}}
 
+
{{TranslationStatus (简体中文)|Wayland|2015-11-06|408148}}
{{警告|Wayland虽然已经发布了1.0.0版,稳定了接口,但各种应用仍然还需要一定时间来适应它,故而目前暂时难以达到替代x11的效果}}
+
'''Wayland''' 是 Linux 的一个新的图形接口协议。使用 Wayland 需要更改或重新安装一部分系统中的软件。更多关于 Wayland 的信息参见 [http://wayland.freedesktop.org/ 主页]。
  
 
== 系统需求 ==
 
== 系统需求 ==
目前 Wayland 只能在使用了 [[Kernel Mode Setting (简体中文)|KMS]] 的系统上工作。
+
目前 Wayland 只能在使用了 [[Kernel mode setting (简体中文)|KMS]] 的系统上工作。
  
 
== 安装 ==
 
== 安装 ==
Wayland 应该已经作为{{pkg|gtk2}}和{{pkg|gtk3}}的依赖安装到系统里面。如果没有,可以从 extra 安装软件包{{pkg|wayland}}。
+
{{注意|Wayland 应该已经作为{{pkg|gtk2}}和{{pkg|gtk3}}的依赖安装到系统里面}}
 +
 
 +
如果没有,可以从 [[official repositories|官方软件仓库]] 安装软件包{{pkg|wayland}}。
  
 
== 使用 ==
 
== 使用 ==
Wayland 仅仅是一个库,无法单独工作。因此使用 Wayland 需要有混合程序(weston), Weston 演示程序、Qt5 或打开 QPA 的 Qt4 库外加 Wayland 插件,还可以选择使用有 Wayland 支持的 GTK+ 库。
+
Wayland 仅仅是一个库,无法单独工作。若要代替X server,需要有混合器(如weston)
  
 
== Weston ==
 
== Weston ==
 
=== 安装 ===
 
=== 安装 ===
从 community 安装 {{pkg|weston}}
+
[[Help:Reading (简体中文)#安装软件包|安装]] {{Pkg|weston}}
 
 
如果出现错误: "Failed to create XKB context",请安装 {{Pkg|xkeyboard-config}}.
 
  
 
=== 使用 ===
 
=== 使用 ===
安装完了 Wayland 及它所信赖的包之后,就可以开始试用了。切换到终端,运行:
+
安装完了 Wayland 及它所依赖的包之后,就可以开始试用了。运行:
 +
  $ weston
 +
或者,要试着运行Weston本身,切换到终端并运行:
 
   $ weston-launch
 
   $ weston-launch
注意如果不以 root 身份运行,可能会出现键盘或是鼠标失灵的情况。
 
 
如果 nouveau 驱动有问题,可以尝试运行:
 
  $ export EGL_DRIVER=/usr/lib/egl/egl_gallium.so
 
  
 
接下来你就可以在 TTY 下打开 wayland 的终端:
 
接下来你就可以在 TTY 下打开 wayland 的终端:
Line 47: Line 45:
 
  $ weston-image image1.jpg image2.jpg...
 
  $ weston-image image1.jpg image2.jpg...
  
显示 PDF 文件:
+
=== 配置 ===
$ weston-view doc1.pdf doc2.pdf...
+
键盘布局,模块的选择,UI的修改的示例配置文件,请参阅{{man|5|weston.ini}}
 +
{{hc|~/.config/weston.ini|
 +
<nowiki>[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
  
== Qt ==
+
#[output]
 +
#name=X1
 +
#mode=1024x768
 +
#transform=flipped-270</nowiki>
 +
}}
  
=== 安装 ===
+
简单的 {{ic|weston.ini}} :
安装 {{Pkg|qt5-base}}.
+
{{hc|~/.config/weston.ini|
 +
<nowiki>[core]
 +
modules=xwayland.so
  
=== 使用 ===
+
[keyboard]
首先,你需要有一个像之前运行 demo 程序的 Wayland compositor,或者一个实验性版本的 KWin 亦可。
+
keymap_layout=gb
  
然后用 qmake 来编译 Qt 工程
+
[launcher]
$ qmake
+
icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png
$ make
+
path=/usr/bin/weston-terminal
  
指定编译库,运行程序
+
[launcher]
$ export QT_QPA_PLATFORM=waylandgl
+
icon=/usr/share/icons/hicolor/24x24/apps/firefox.png
$ ./binaryname
+
path=/usr/bin/firefox
  
=== Qt Compositor ===
 
有一个正在进行的 [http://labs.qt.nokia.com/2011/03/18/multi-process-lighthouse/ Qt-Compositor] 工程,它的目的在于在 Wayland 基础之上实现 Qt Compositor 层。
 
  
== 其他 GUI 库 ==
+
[output]
参见([http://wayland.freedesktop.org/toolkits.html 来自官方网站的页面])
+
name=LVDS1
 +
mode=1680x1050
 +
transform=90</nowiki>
 +
}}
  
===GTK+===
+
==== XWayland ====
[testing]软件仓库中的{{pkg|gtk3}}GTK+ 已经提供了 Wayland 支持. GTK+ 默认会使用 X11。可以通过把<code>GDK_BACKEND</code>环境变量设为<code>wayland</code>来改变这一规则。
+
[[安装]]软件包{{Pkg|xorg-server-xwayland}}.
  
===Clutter===
+
要通过 Weston 运行 X 程序,需要启动 Xwayland 进行请求处理。需要如下配置文件:
Clutter 工具包有 Wayland 后端支持,可以作为 Wayland 程式运行。这一后端支持已经存在于开发主分支中[http://git.gnome.org/browse/clutter main repo],可以以 <code>--with-flavour=wayland</code>来加以配置
 
  
===SDL===
+
{{hc|~/.config/weston.ini|
 +
<nowiki>[core]
 +
modules=xwayland.so</nowiki>
 +
}}
  
Benjamin Franzke 将 SDL 移植到 Wayland 上, 可以从freedesktop.org [http://cgit.freedesktop.org/~bnf/sdl-wayland/ sdl-wayland repo]处获得。Andre Heider 接着 Benjamin Franzke 的工作进行开发,代码在libsdl 的 [https://github.com/dhewg/libsdl/tree/wl wayland 分支]。
+
==== 视频录制 ====
 +
Weston has build-in screencast recording which can be started and stopped by pressing the {{ic|Super+r}} key combination. Screencasts are saved to the file {{ic|capture.wcap}} in the current working directory of Weston.  
  
===EFL===
+
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.  
EFL 已经完全支持 Wayland。请参考[http://trac.enlightenment.org/e/wiki/Wayland 这里]获取更多细节。
 
  
== 窗口管理器和桌面 shell==
+
To convert the file to webm, execute:
  
===KDE===
+
$ wcap-decode capture.wcap --yuv4mpeg2 | vpxenc --target-bitrate=1024 --best -t 4 -o foo.webm -
[http://blog.martin-graesslin.com/blog/2011/03/kwin-at-gsoc-2011/ 在早期的工作]中提供了在 Wayland 上运行 KWin (KDE 窗口管理器)的方法。
 
  
===GNOME===
+
To convert the file to ogv, execute:
GNOME 将在未来的版本中移植到 Wayland 上。
 
  
===Unity===
+
$ wcap-decode capture.wcap --yuv4mpeg2 | theora_encode - -o cap.ogv
Ubuntu 桌面 shell Unity 以 Compiz 为窗口管理器, 后者已经被移植到了 Wayland 上 [http://www.markshuttleworth.com/archives/551 announced]。
 
  
===Pure Wayland===
+
==== 高DPI显示器 ====
 +
For [[wikipedia:Retina_Display|Retina]] or [[HiDPI]] displays, use:
  
{{Warning|Some really quick notes on installing a pure (no X11) wayland system on Archlinux. This is from source and installed into /usr/local. May break your system. You have been warned. (by elethiomel@gmail.com)}}
+
{{hc|~/.config/weston.ini|
 +
<nowiki>
 +
[output]
 +
name=...
 +
scale=2
 +
</nowiki>
 +
}}
  
First install a base Archlinux install with base and base-devel. Do not install xorg or any of its libraries
+
==== Shell font ====
 +
Weston uses the default sans-serif font for window title bars, clocks, etc. See [[Font configuration#Replace or set default fonts]] for instructions on how to change this font.
  
===== Wayland =====
+
== 图形库 ==
 +
在[http://wayland.freedesktop.org/toolkits.html 官方资料]上查看详细信息
  
$ pacman -S libffi
+
===GTK+ 3===
$ git clone git://anongit.freedesktop.org/wayland/wayland
+
[extra]软件仓库中的{{pkg|gtk3}} 已经提供了 Wayland 支持.  
$ cd wayland
 
$ ./autogen.sh --prefix=/usr/local
 
$ make
 
$ make install
 
  
===== DRM and Mesa =====
+
GTK+ 3.0 开始,GTK+ 可以在运行时同时支持多个后端,和 Qt 一样进行切换。
  
$ git clone git://anongit.freedesktop.org/git/mesa/drm
+
Wayland 和 X 后端都启用时,GTK+ 默认会使用 X11。可以通过把{{ic|GDK_BACKEND}}环境变量设为{{ic|wayland}}来改变这一规则。
$ cd drm
 
$ ./autogen.sh --prefix=/usr/local
 
$ make
 
$ make install
 
  
$ git clone git://anongit.freedesktop.org/mesa/mesa
+
=== Qt5 ===
$ cd mesa
 
$ CFLAGS=-DMESA_EGL_NO_X11_HEADERS ./autogen.sh --prefix=/usr/local --enable-gles2 --disable-gallium-egl --with-egl-platforms=wayland,drm --enable-gbm --enable-shared-glapi --with-gallium-drivers=r300,r600,swrast,nouveau --disable-glx --disable-xlib
 
$ make
 
$ make install
 
  
===== xorg-macros =====
+
{{Grp|qt5}} 软件包已经提供了 Wayland 支持。 
 +
要使用 wayland 插件运行程序,需要设置 [[environment variable|环境变量]]. {{ic|1=QT_QPA_PLATFORM=wayland-egl}}
  
$ git clone http://anongit.freedesktop.org/git/xorg/util/macros.git
+
===Clutter===
$ cd macros/
+
Clutter 工具包有 Wayland 后端支持,可以作为 Wayland 程式运行。这一后端支持已经存在软件仓库的版本中。要配置 {{ic|CLUTTER_BACKEND&#61;wayland}}.
$ ./autogen.sh --prefix=/usr/local/
 
$ make
 
$ make install
 
  
===== libxkbcommon =====
+
===SDL===
  
$ git clone git://people.freedesktop.org/xorg/lib/libxkbcommon.git
+
Experimental wayland support is now in SDL 2.0.2 and enabled by default on Arch Linux.To run a SDL application on Wayland, set {{ic|SDL_VIDEODRIVER&#61;wayland}}.
$ cd libxkbcommon/
 
$ export ACLOCAL_PATH=/usr/local/share/aclocal/
 
$ ./autogen.sh --prefix=/usr/local/ --with-xkb-config-root=/usr/local/share/X11/xkb
 
$ make
 
$ make install
 
  
===== pixman =====
+
=== GLFW ===
 +
Experimental wayland support is now in GLFW 3.1 and can be enabled with the {{ic|-DGLFW_USE_WAYLAND&#61;ON}} CMake option at compile time. You can also install the package {{AUR|glfw-wayland-git}} from the AUR.
  
$ git clone git://anongit.freedesktop.org/pixman
+
===EFL===
$ cd pixman/
+
EFL 已经完全支持 Wayland。请参考[http://trac.enlightenment.org/e/wiki/Wayland 这里]获取更多细节。
$ ./autogen.sh --prefix=/usr/local/
 
$ make
 
$ make install
 
 
 
===== cairo =====
 
  
Note - no glx/gl or xcb - EGL only.
+
== 窗口管理器和桌面 shell==
 +
{| class="wikitable"
 +
! Name
 +
! Type
 +
! Description
 +
|-
 +
| GNOME
 +
| Compositing
 +
| 参见 [[GNOME#Starting GNOME]]{{Broken section link}}.
 +
|-
 +
| Hawaii
 +
| ''(Unclear)''
 +
| 参见 [[Hawaii]].
 +
|-
 +
| sway
 +
| Tiling
 +
| [https://github.com/SirCmpwn/sway Sway] is an i3-compatible window manager for Wayland.
 +
|-
 +
| KDE
 +
| 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]. With [https://community.kde.org/KWin/Wayland#Start_a_Plasma_session_on_Wayland KDE Plasma 5.4], the first technology preview of a Wayland session is released but it is currently targeted for the mobile platform and does not yet allow to use it as a full replacement for Xorg based desktop.
 +
|-
 +
| Orbment
 +
| Tiling
 +
| [https://github.com/Cloudef/orbment orbment] (previously loliwm) is a tiling WM for Wayland.
 +
|-
 +
| Velox
 +
| Tiling
 +
| [https://github.com/michaelforney/velox velox] is a simple window manager based on swc. It is inspired by [[dwm]] and [[xmonad]].
 +
|-
 +
| Orbital
 +
| 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]].
 +
|-
 +
| Papyros Shell
 +
| ''(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.
 +
|-
 +
| Maynard
 +
| ''(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.
 +
|-
 +
| Motorcar
 +
| ''(Unclear)''
 +
| [https://github.com/evil0sheep/motorcar Motorcar] is a wayland compositor to explore 3D windowing.
 +
|}
  
$ pacman -S libpng
+
Some of installed wayland desktop clients might store information in {{ic|/usr/share/wayland-sessions/*.desktop}} files about how to start them in wayland.
$ git clone git://anongit.freedesktop.org/cairo
 
$ cd cairo
 
$ CFLAGS=-DMESA_EGL_NO_X11_HEADERS ./autogen.sh --prefix=/usr/local/  --disable-xcb  --enable-glesv2
 
$ make
 
$ make install
 
  
===== xkb files =====
+
==疑难解答==
  
Either
+
=== LLVM assertion failure ===
 +
If you get an LLVM assertion failure, you need to rebuild {{Pkg|mesa}} without Gallium LLVM until this problem is fixed.
  
a) Copy from an existing system a set of xkb layouts
+
This may imply disabling some drivers which require LLVM.
 +
You may also try exporting the following, if having problems with hardware drivers:
  
  $ scp -r /usr/share/X11/xkb to /usr/local/share/X11/
+
  $ export EGL_DRIVER=/usr/lib/egl/egl_gallium.so
  
or
+
=== Weston fails to launch after update to 1.7 ===
 +
This is possibly caused by the `desktop-shell.so` module being loaded by your weston.ini. This used to be required, but is not anymore.
  
b) build  {{ic|xkeyboard-config}} from git with {{ic|--prefix&#61;/usr/local}} and {{ic|--disable-runtime-deps}}
+
Remove it from the {{ic|[core]}} section:
  
===== weston =====
+
{{hc|~/.config/weston.ini|
 +
<nowiki>[core]
 +
modules=xwayland.so,desktop-shell.so</nowiki>
 +
}}
  
$ git clone git://anongit.freedesktop.org/wayland/weston
+
生成:
$ cd weston/
 
$ CFLAGS="-I/usr/local/include/libdrm/ -DMESA_EGL_NO_X11_HEADERS" ./autogen.sh --prefix=/usr/local/ --with-cairo-glesv2 --disable-xwayland --disable-x11-compositor --disable- xwayland-test
 
$ make
 
$ make install
 
  
==问题解决==
+
{{hc|~/.config/weston.ini|
 +
<nowiki>[core]
 +
modules=xwayland.so</nowiki>
 +
}}
  
==更多信息==
+
== 参阅 ==
* [[Cursor Themes]]
+
* [[Cursor themes]]
[https://bbs.archlinux.org/viewtopic.php?id=107499 forum discussion] 页面将持续关注 Wayland 信息 ,如有兴趣请留意。
+
* [https://bbs.archlinux.org/viewtopic.php?id=107499 forum discussion] 页面将持续关注 Wayland 信息 ,如有兴趣请留意。

Latest revision as of 17:20, 1 May 2018

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

Wayland 是 Linux 的一个新的图形接口协议。使用 Wayland 需要更改或重新安装一部分系统中的软件。更多关于 Wayland 的信息参见 主页

系统需求

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

安装

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

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

使用

Wayland 仅仅是一个库,无法单独工作。若要代替X server,需要有混合器(如weston)

Weston

安装

安装 weston

使用

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

 $ weston

或者,要试着运行Weston本身,切换到终端并运行:

 $ weston-launch

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

$ weston-terminal

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

$ weston-flower 

在 Wayland 上运行 glxgears 程序:

$ weston-gears 

显示图片:

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

配置

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

~/.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

安装软件包xorg-server-xwayland.

要通过 Weston 运行 X 程序,需要启动 Xwayland 进行请求处理。需要如下配置文件:

~/.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显示器

For Retina or HiDPI displays, use:

~/.config/weston.ini

[output]
name=...
scale=2

Shell font

Weston uses the default sans-serif font for window title bars, clocks, etc. See Font configuration#Replace or set default fonts for instructions on how to change this font.

图形库

官方资料上查看详细信息

GTK+ 3

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

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

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

Qt5

qt5 软件包已经提供了 Wayland 支持。 要使用 wayland 插件运行程序,需要设置 环境变量. QT_QPA_PLATFORM=wayland-egl

Clutter

Clutter 工具包有 Wayland 后端支持,可以作为 Wayland 程式运行。这一后端支持已经存在软件仓库的版本中。要配置 CLUTTER_BACKEND=wayland.

SDL

Experimental wayland support is now in SDL 2.0.2 and enabled by default on Arch Linux.To run a SDL application on Wayland, set SDL_VIDEODRIVER=wayland.

GLFW

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

EFL

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

窗口管理器和桌面 shell

Name Type Description
GNOME Compositing 参见 GNOME#Starting GNOME[broken link: invalid section].
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. With KDE Plasma 5.4, the first technology preview of a Wayland session is released but it is currently targeted for the mobile platform and does not yet allow to use it as a full replacement for Xorg based desktop.
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.

Some of installed wayland desktop clients might store information in /usr/share/wayland-sessions/*.desktop files about how to start them in wayland.

疑难解答

LLVM assertion failure

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. You may also try exporting the following, if having problems with hardware drivers:

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

Weston fails to launch after update to 1.7

This is possibly caused by the `desktop-shell.so` module being loaded by your weston.ini. This used to be required, but is not anymore.

Remove it from the [core] section:

~/.config/weston.ini
[core]
modules=xwayland.so,desktop-shell.so

生成:

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

参阅