Difference between revisions of "Wayland"

From ArchWiki
Jump to: navigation, search
m (XWayland: Grammar and clarity)
(GNOME: fix link)
(25 intermediate revisions by 9 users not shown)
Line 3: Line 3:
 
[[ja:Wayland]]
 
[[ja:Wayland]]
 
[[zh-CN:Wayland]]
 
[[zh-CN:Wayland]]
{{Article summary start}}
+
{{Related articles start}}
{{Article summary text|A guide to installing and running the Wayland display server.}}
+
{{Related|KMS}}
{{Article summary heading|Related}}
+
{{Related|Xorg}}
{{Article summary wiki|KMS}}
+
{{Related|Mir}}
{{Article summary wiki|Xorg}}
+
{{Related articles end}}
{{Article summary end}}
+
 
'''Wayland''' is a new windowing protocol for Linux. Utilization of Wayland requires changes to and re-installation of parts of your system's software. For more information on Wayland see its [http://wayland.freedesktop.org/ homepage].
 
'''Wayland''' is a new windowing protocol for Linux. Utilization of Wayland requires changes to and re-installation of parts of your system's software. For more information on Wayland see its [http://wayland.freedesktop.org/ homepage].
  
Line 15: Line 14:
 
== Requirements ==
 
== Requirements ==
  
Currently Wayland will only work with on a system that is utilizing [[KMS]].
+
Currently Wayland will only work on systems utilizing [[KMS]].
  
 
== Installation ==
 
== Installation ==
Line 34: Line 33:
  
 
{| style="float:right;border:1px #cccccc solid;margin:5px;padding:5px;width:200px;"
 
{| style="float:right;border:1px #cccccc solid;margin:5px;padding:5px;width:200px;"
|+ ''Keyboard shortcuts (super = windows key)'' {{Ic|Ctrl-b}}
+
|+ '''''Keyboard Shortcuts''' (super = windows key - can be changed, see weston.ini)'' {{Ic|Ctrl-b}}
 
!Cmd
 
!Cmd
 
!Action
 
!Action
 
|-
 
|-
 
|Ctrl + Alt + Backspace
 
|Ctrl + Alt + Backspace
|Quit weston
+
|Quit Weston
 
|-
 
|-
|Super + Scroll / PageUpDown
+
|Super + Scroll (or PageUp/PageDown)
|Zoom into desktop
+
|Zoom in/out of desktop
 
|-
 
|-
 
|Super + Tab
 
|Super + Tab
 
|Switch windows
 
|Switch windows
 +
|-
 +
|Super + LMB
 +
|Move Window
 +
|-
 +
|Super + MMB
 +
|Resize Window
 +
|-
 +
|Super + RMB
 +
|Rotate Window !
 +
|-
 +
|Super + Tab
 +
|Switch windows
 +
|-
 +
|Super + K
 +
|Force Kill Active Window
 +
|-
 +
|Super + KeyUp/KeyDown
 +
|Switch Prev/Next Workspace
 +
|-
 +
|Super + Shift + KeyUp/KeyDown
 +
|Grab Current Window and Switch Workspace
 +
|-
 +
|Super + F'''''n'''''
 +
|Switch to Workspace '''''n'''''
 +
 
|}
 
|}
  
Now that Wayland and its requirements are installed you should be ready to test it out. Try switching to a terminal and running:
+
Now that Wayland and its requirements are installed you should be ready to test it out.  
$ weston-launch
+
 
 
{{Note|
 
{{Note|
* You need to be in the video group for Weston to start; this command is not supposed to be run as root and doing that may freeze your VT.
+
You need to be in the video group for Weston to start; this command is not supposed to be run as root and doing so may freeze your VT !
* If you get an LLVM assertion failure, you need to rebuild {{Pkg|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
 
  
 
It is possible to run Weston inside a running X session:
 
It is possible to run Weston inside a running X session:
 
  $ weston
 
  $ weston
  
Then at a TTY you can run the demos. To launch a terminal emulator:
+
Alternatively, to launch Weston natively, try switching to a terminal and running:
 +
$ weston-launch
 +
 
 +
Then at a TTY within Weston, you can run the demos. To launch a terminal emulator:
 
  $ weston-terminal
 
  $ weston-terminal
  
Line 77: Line 100:
  
 
=== Configuration ===
 
=== Configuration ===
Example configuration file for keyboard layout, module selection and UI modifications:
+
Example configuration file for keyboard layout, module selection and UI modifications. See {{ic|man weston.ini}} for full details:
 
{{hc|~/.config/weston.ini|
 
{{hc|~/.config/weston.ini|
<nowiki>[keyboard]
+
<nowiki>[core]
keymap_layout=en
+
### uncomment this line for xwayland support ###
 +
#modules=desktop-shell.so,xwayland.so
  
 
[shell]
 
[shell]
type=desktop-shell.so
+
background-image=/usr/share/backgrounds/gnome/Aqua.jpg
background-image=/path/to/your/wallpaper.jpg
+
 
background-color=0xff002244
 
background-color=0xff002244
 
panel-color=0x90ff0000
 
panel-color=0x90ff0000
 
locking=true
 
locking=true
 
animation=zoom
 
animation=zoom
binding-modifier=ctrl
+
#binding-modifier=ctrl
num-workspaces=6
+
#num-workspaces=6
 +
### for cursor themes install xcursor-themes pkg from Extra. ###
 +
#cursor-theme=whiteglass
 +
#cursor-size=24
  
#type=tablet-shell.so
+
### tablet options ###
 
#lockscreen-icon=/usr/share/icons/gnome/256x256/actions/lock.png
 
#lockscreen-icon=/usr/share/icons/gnome/256x256/actions/lock.png
 
#lockscreen=/usr/share/backgrounds/gnome/Garden.jpg
 
#lockscreen=/usr/share/backgrounds/gnome/Garden.jpg
 
#homescreen=/usr/share/backgrounds/gnome/Blinds.jpg
 
#homescreen=/usr/share/backgrounds/gnome/Blinds.jpg
 
#animation=fade
 
#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]
 
[launcher]
Line 105: Line 144:
 
icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png
 
icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png
 
path=/usr/bin/weston-terminal
 
path=/usr/bin/weston-terminal
 +
 +
[launcher]
 +
icon=/usr/share/icons/hicolor/24x24/apps/google-chrome.png
 +
path=/usr/bin/google-chrome
 +
 +
[launcher]
 +
icon=/usr/share/icons/gnome/24x24/apps/arts.png
 +
path=./clients/flower
  
 
[screensaver]
 
[screensaver]
Line 111: Line 158:
 
duration=600
 
duration=600
  
 +
[input-method]
 +
path=/usr/libexec/weston-keyboard
 +
 +
###  for Laptop displays  ###
 
#[output]
 
#[output]
 
#name=LVDS1
 
#name=LVDS1
Line 118: Line 169:
 
#[output]
 
#[output]
 
#name=VGA1
 
#name=VGA1
#mode=173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
+
#modeline=173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
 
#transform=flipped
 
#transform=flipped
  
Line 126: Line 177:
 
#transform=flipped-270</nowiki>
 
#transform=flipped-270</nowiki>
 
}}
 
}}
 +
 +
Minimal {{ic|weston.ini}} :
 +
{{hc|~/.config/weston.ini|
 +
<nowiki>[core]
 +
modules=desktop-shell.so,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/google-chrome.png
 +
path=/usr/bin/google-chrome
 +
 +
 +
[output]
 +
name=LVDS1
 +
mode=1680x1050
 +
transform=90</nowiki>
 +
}}
 +
 
==== XWayland ====
 
==== XWayland ====
If you plan to run X-applications that don't support Wayland, you have to install {{AUR|xorg-server-xwayland-git}} and patched graphic drivers according to your system, e.g. {{AUR|xf86-video-intel-xwayland-git}}. After that, create or modify following configuration file:
+
XWayland ''is'' an XOrg server and compiles as a drop in replacement. The only difference is that it is sourced from the Wayland branch of the xorg-server repository and as such has the Wayland extensions. These extensions allow it to run as a client of Weston.
 +
 
 +
When you want to run an X application from within Weston, it spins up this modified X server to service the request.
 +
 
 +
{{Warning|The steps in this section set out ''to replace your graphics stack''. An incomplete installation could result in a broken graphical environment.}}
 +
 
 +
If you plan to run native X-applications inside Wayland, then you have to install {{AUR|xorg-server-xwayland}} and either patched graphic drivers according to your system, e.g. {{AUR|xf86-video-intel-xwayland-git}}, or the generic wlglamor fallback found at {{AUR|xf86-video-wlglamor-git}}. After that, create or modify following configuration file:
 
{{hc|~/.config/weston.ini|
 
{{hc|~/.config/weston.ini|
 
<nowiki>[core]
 
<nowiki>[core]
 
modules=xwayland.so,desktop-shell.so</nowiki>
 
modules=xwayland.so,desktop-shell.so</nowiki>
 
}}
 
}}
Now you can also run X applications in some kind of "compatibility mode".
+
Now you can also run X applications in some kind of "compatibility mode". Final XWayland support should be available with the version 1.16 X-server release which is not due to land until [http://www.phoronix.com/scan.php?page=news_item&px=MTQ1NzM mid 2014].
 +
 
 +
The AUR packages may require some modification in order to compile successfully though ([https://bbs.archlinux.org/viewtopic.php?pid=1328812#p1328812 see this thread]). An alternative is to compile directly from source. This can be done in 3 steps (it is assumed you already have the {{ic|base-devel}} group installed).
 +
 
 +
First install the standard XOrg packages and the appropriate video driver, this will pull in the required dependencies.
 +
 
 +
{{Note|Unless you are on a fresh installation, you likely already have these. Just ensure you have the latest versions and if using [[ATI]] or [[NVIDIA]] that you are using the ''open source'' drivers.
 +
Wayland graphics hardware support seems to go Intel > ATI > NVidia so YMMV on non-Intel hardware. However the new {{ic|xf86-video-wlshm}} driver has been produced with the purpose of having high compatibility across all hardware stacks. }}
 +
 
 +
# pacman -S xorg-server xorg-server-utils xorg-xinit mesa
 +
# pacman -S xf86-video-''yourdriver''
 +
 
 +
Second, checkout and compile the XWayland xorg server.
 +
 
 +
{{Note|If you have 3GB of RAM or more, performing these operations in memory (e.g. {{ic|/tmp}}) is probably a good idea.}}
 +
 
 +
{{bc|<nowiki>
 +
$ git clone git://anongit.freedesktop.org/xorg/xserver -b xwayland
 +
$ cd xserver
 +
$ ./autogen.sh --prefix=/usr/  --enable-xorg --enable-wayland
 +
$ make
 +
 
 +
# make install
 +
</nowiki>}}
 +
 
 +
Third, checkout and compile your video driver. The repos can be found on [http://wayland.freedesktop.org/xserver.html the official Wayland website]. As noted above, {{ic|xf86-video-wlshm}} is likely a good option for non-Intel graphics.
 +
Following are the instructions for Intel hardware.
 +
 
 +
{{bc|<nowiki>
 +
$ git clone git://anongit.freedesktop.org/xorg/driver/xf86-video-intel -b xwayland
 +
$ cd xf86-video-intel
 +
$ ./autogen.sh --prefix=/usr/ --enable-dri --disable-xaa --with-default-accel=sna
 +
$ make
 +
 
 +
# make install
 +
</nowiki>}}
 +
 
 +
If your Intel graphics are pre-Sandybridge use {{ic|<nowiki>--with-default-accel=uxa</nowiki>}} instead.
 +
 
 +
Now that you have replaced your xorg-server and graphics driver with the XWayland patched versions you should be able to run XWayland.
 +
To test, check that you have a small X application like {{ic|xterm}} or {{ic|xclock}} in your path, fire up Weston using {{ic|weston-launch}}, open weston-terminal and run the X application.
  
 
== GUI libraries ==
 
== GUI libraries ==
Line 148: Line 269:
 
=== Qt5 ===
 
=== Qt5 ===
  
You need to install {{Pkg|qt5-base}} and the wayland plugin {{AUR|qtwayland-git}}.
+
You need to either <strike>rebuild {{Pkg|qt5-base}} with ''-opengl es2''</strike> (currently not working, see http://lists.qt-project.org/pipermail/development/2013-December/014789.html ) or use {{AUR|qtbase-git}}. Then build the wayland plugin {{AUR|qtwayland-git}}.
  
 
To run a Qt5 app with the Wayland plugin, set {{ic|QT_QPA_PLATFORM&#61;wayland-egl}}.
 
To run a Qt5 app with the Wayland plugin, set {{ic|QT_QPA_PLATFORM&#61;wayland-egl}}.
Line 160: Line 281:
 
=== SDL ===
 
=== SDL ===
  
Benjamin Franzke is working on a port of SDL to Wayland, it's available in his [http://cgit.freedesktop.org/~bnf/sdl-wayland/ sdl-wayland repo] on freedesktop.org. Further development upon Benjamins work was done by Andre Heider in his [https://github.com/dhewg/libsdl/tree/wl wayland branch] of libsdl. Scott Moreau picked up where others left and fixed the library to work with 1.0 protocol. You can find his work in [https://github.com/soreau/SDL/tree/wayland wayland branch] of SDL repository.
+
Benjamin Franzke is working on a port of SDL to Wayland, it is available in his [http://cgit.freedesktop.org/~bnf/sdl-wayland/ sdl-wayland repo] on freedesktop.org. Further development upon Benjamins work was done by Andre Heider in his [https://github.com/dhewg/libsdl/tree/wl wayland branch] of libsdl. Scott Moreau picked up where others left and fixed the library to work with 1.0 protocol. You can find his work in [https://github.com/soreau/SDL/tree/wayland wayland branch] of SDL repository.
  
 
To run a SDL application on Wayland, set {{ic|SDL_VIDEODRIVER&#61;wayland}}.
 
To run a SDL application on Wayland, set {{ic|SDL_VIDEODRIVER&#61;wayland}}.
Line 175: Line 296:
 
KDE 4.11 beta supports starting [http://blog.martin-graesslin.com/blog/2013/06/starting-a-full-kde-plasma-session-in-wayland/ KWin under Wayland system compositor]. There is currently no support for using KWin as a session compositor.
 
KDE 4.11 beta supports starting [http://blog.martin-graesslin.com/blog/2013/06/starting-a-full-kde-plasma-session-in-wayland/ KWin under Wayland system compositor]. There is currently no support for using KWin as a session compositor.
  
=== GNOME ===  
+
=== GNOME ===
Since version 3.10, Gnome has experimental Wayland support but you have to install {{AUR|xwayland-git}} and a equivalent patched graphics driver, e.g. {{AUR|xf86-video-intel-xwayland-git}} to get ''Mutter'' to work. For details look into the [https://live.gnome.org/Wayland GNOME wiki].
+
Since version 3.10, Gnome has experimental Wayland support but you have to install {{AUR|xwayland-git}} and a equivalent patched graphics driver, e.g. {{AUR|xf86-video-intel-xwayland-git}} to get ''Mutter'' to work. For details look into the [https://live.gnome.org/Initiatives/Wayland GNOME wiki]
 +
.
 
{{bc|<nowiki>gnome-session --session=gnome-wayland</nowiki>}}
 
{{bc|<nowiki>gnome-session --session=gnome-wayland</nowiki>}}
  
Line 189: Line 311:
 
First install a base Arch Linux install with base and base-devel. Do not install xorg or any of its libraries.
 
First install a base Arch Linux install with base and base-devel. Do not install xorg or any of its libraries.
  
===== Wayland, DRM, Pixman, libxkbcommon =====
+
==== Wayland, DRM, Pixman, libxkbcommon ====
  
 
  $ pacman -S wayland libdrm pixman libxkbcommon
 
  $ pacman -S wayland libdrm pixman libxkbcommon
  
===== Mesa =====
+
==== Mesa ====
  
 
  $ sudo pacman -S python2 libxml2 llvm
 
  $ sudo pacman -S python2 libxml2 llvm
Line 202: Line 324:
 
  $ sudo make install
 
  $ sudo make install
  
===== cairo =====
+
==== cairo ====
  
 
Note - no glx/gl or xcb - EGL only.
 
Note - no glx/gl or xcb - EGL only.
Line 213: Line 335:
 
  $ sudo make install
 
  $ sudo make install
  
===== weston =====
+
==== weston ====
 
  $ sudo pacman -S gegl mtdev
 
  $ sudo pacman -S gegl mtdev
 
  ''(choose mesa-gl from options for libgl)''
 
  ''(choose mesa-gl from options for libgl)''
Line 221: Line 343:
 
  $ make
 
  $ make
 
  $ sudo make install
 
  $ sudo make install
 +
 +
==Troubleshooting==
 +
 +
=== LLVM assertion failure ===
 +
If you get an LLVM assertion failure, you need to rebuild {{Pkg|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
  
 
== See also ==
 
== See also ==
Line 226: Line 358:
 
* [https://bbs.archlinux.org/viewtopic.php?id=107499 Arch Linux forum discussion]
 
* [https://bbs.archlinux.org/viewtopic.php?id=107499 Arch Linux forum discussion]
 
* [http://wayland.freedesktop.org/docs/html/ Wayland documentation online]
 
* [http://wayland.freedesktop.org/docs/html/ Wayland documentation online]
 +
* [http://www.chaosreigns.com/wiki/Wayland_State Wayland usability wiki]

Revision as of 16:51, 30 January 2014

Related articles

Wayland is a new windowing protocol for Linux. Utilization of Wayland requires changes to and re-installation of parts of your system's software. For more information on Wayland see its homepage.

Warning: Wayland is under heavy development. Support can not be guaranteed and it may not function as you expect.

Requirements

Currently Wayland will only work on systems utilizing KMS.

Installation

Wayland is most probably installed on your system already as it is an indirect dependency of gtk2 and gtk3. If it is not installed, you will find the wayland package in the official repositories.

Usage

As Wayland is only a library, it is useless on its own. To use it, you need a compositor (like Weston), Weston demo applications, Qt5 with Wayland plugin, and/or GTK+ with Wayland support.

Weston

Installation

You need to install weston from the official repositories.

Usage

Keyboard Shortcuts (super = windows key - can be changed, see weston.ini) Ctrl-b
Cmd Action
Ctrl + Alt + Backspace Quit Weston
Super + Scroll (or PageUp/PageDown) Zoom in/out of desktop
Super + Tab Switch windows
Super + LMB Move Window
Super + MMB Resize Window
Super + RMB Rotate Window !
Super + Tab Switch windows
Super + K Force Kill Active Window
Super + KeyUp/KeyDown Switch Prev/Next Workspace
Super + Shift + KeyUp/KeyDown Grab Current Window and Switch Workspace
Super + Fn Switch to Workspace n

Now that Wayland and its requirements are installed you should be ready to test it out.

Note:

You need to be in the video group for Weston to start; this command is not supposed to be run as root and doing so may freeze your VT !

It is possible to run Weston inside a running X session:

$ weston

Alternatively, to launch Weston natively, try switching to a terminal and running:

$ weston-launch

Then at a TTY within Weston, you can run the demos. To launch a terminal emulator:

$ weston-terminal

To move flowers around the screen:

$ weston-flower 

To test the frame protocol (runs glxgears):

$ weston-gears

To display images:

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

To display PDF Files:

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

Configuration

Example configuration file for keyboard layout, module selection and UI modifications. See man weston.ini for full details:

~/.config/weston.ini
[core]
### uncomment this line for xwayland support ###
#modules=desktop-shell.so,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/google-chrome.png
path=/usr/bin/google-chrome

[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
#modeline=173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
#transform=flipped

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

Minimal weston.ini :

~/.config/weston.ini
[core]
modules=desktop-shell.so,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/google-chrome.png
path=/usr/bin/google-chrome


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

XWayland

XWayland is an XOrg server and compiles as a drop in replacement. The only difference is that it is sourced from the Wayland branch of the xorg-server repository and as such has the Wayland extensions. These extensions allow it to run as a client of Weston.

When you want to run an X application from within Weston, it spins up this modified X server to service the request.

Warning: The steps in this section set out to replace your graphics stack. An incomplete installation could result in a broken graphical environment.

If you plan to run native X-applications inside Wayland, then you have to install xorg-server-xwaylandAUR and either patched graphic drivers according to your system, e.g. xf86-video-intel-xwayland-gitAUR, or the generic wlglamor fallback found at xf86-video-wlglamor-gitAUR. After that, create or modify following configuration file:

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

Now you can also run X applications in some kind of "compatibility mode". Final XWayland support should be available with the version 1.16 X-server release which is not due to land until mid 2014.

The AUR packages may require some modification in order to compile successfully though (see this thread). An alternative is to compile directly from source. This can be done in 3 steps (it is assumed you already have the base-devel group installed).

First install the standard XOrg packages and the appropriate video driver, this will pull in the required dependencies.

Note: Unless you are on a fresh installation, you likely already have these. Just ensure you have the latest versions and if using ATI or NVIDIA that you are using the open source drivers. Wayland graphics hardware support seems to go Intel > ATI > NVidia so YMMV on non-Intel hardware. However the new xf86-video-wlshm driver has been produced with the purpose of having high compatibility across all hardware stacks.
# pacman -S xorg-server xorg-server-utils xorg-xinit mesa
# pacman -S xf86-video-yourdriver

Second, checkout and compile the XWayland xorg server.

Note: If you have 3GB of RAM or more, performing these operations in memory (e.g. /tmp) is probably a good idea.
$ git clone git://anongit.freedesktop.org/xorg/xserver -b xwayland
$ cd xserver
$ ./autogen.sh --prefix=/usr/  --enable-xorg --enable-wayland
$ make

# make install

Third, checkout and compile your video driver. The repos can be found on the official Wayland website. As noted above, xf86-video-wlshm is likely a good option for non-Intel graphics. Following are the instructions for Intel hardware.

$ git clone git://anongit.freedesktop.org/xorg/driver/xf86-video-intel -b xwayland
$ cd xf86-video-intel
$ ./autogen.sh --prefix=/usr/ --enable-dri --disable-xaa --with-default-accel=sna
$ make

# make install

If your Intel graphics are pre-Sandybridge use --with-default-accel=uxa instead.

Now that you have replaced your xorg-server and graphics driver with the XWayland patched versions you should be able to run XWayland. To test, check that you have a small X application like xterm or xclock in your path, fire up Weston using weston-launch, open weston-terminal and run the X application.

GUI libraries

(See details on the official website)

GTK+

You need to install gtk3 from the official repositories, which now has the Wayland backend enabled.

With GTK+ 3.0, GTK+ gained support for multiple backends at runtime and can switch between backends in the same way Qt can with lighthouse.

When both Wayland and X backends are enabled, GTK+ will default to the X11 backend, but this can be overridden by modifying an environment variable: GDK_BACKEND=wayland.

Qt5

You need to either rebuild qt5-base with -opengl es2 (currently not working, see http://lists.qt-project.org/pipermail/development/2013-December/014789.html ) or use qtbase-gitAUR. Then build the wayland plugin qtwayland-gitAUR.

To run a Qt5 app with the Wayland plugin, set QT_QPA_PLATFORM=wayland-egl.

Clutter

The Clutter toolkit has a Wayland backend that allows it to run as a Wayland client. The backend is enabled in the official package in extra.

To run a Clutter app on Wayland, set CLUTTER_BACKEND=wayland.

SDL

Benjamin Franzke is working on a port of SDL to Wayland, it is available in his sdl-wayland repo on freedesktop.org. Further development upon Benjamins work was done by Andre Heider in his wayland branch of libsdl. Scott Moreau picked up where others left and fixed the library to work with 1.0 protocol. You can find his work in wayland branch of SDL repository.

To run a SDL application on Wayland, set SDL_VIDEODRIVER=wayland.

EFL

EFL has complete Wayland support. To run a EFL application on Wayland, see Wayland project page.

Window managers and desktop shells

KDE

KDE 4.11 beta supports starting KWin under Wayland system compositor. There is currently no support for using KWin as a session compositor.

GNOME

Since version 3.10, Gnome has experimental Wayland support but you have to install xwayland-gitAUR and a equivalent patched graphics driver, e.g. xf86-video-intel-xwayland-gitAUR to get Mutter to work. For details look into the GNOME wiki .

gnome-session --session=gnome-wayland

i3

Some developers from i3 have sprouted a completely new project for implementing a shell plugin for Weston to implement the same features and style of i3.

Pure Wayland

Warning: Some really quick notes on installing a pure (no X11) Wayland system on Arch Linux. This is from source and installed into /usr/local. May break your system. You have been warned.

First install a base Arch Linux install with base and base-devel. Do not install xorg or any of its libraries.

Wayland, DRM, Pixman, libxkbcommon

$ pacman -S wayland libdrm pixman libxkbcommon

Mesa

$ sudo pacman -S python2 libxml2 llvm
$ git clone git://anongit.freedesktop.org/mesa/mesa
$ 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
$ sudo make install

cairo

Note - no glx/gl or xcb - EGL only.

$ pacman -S libpng
$ 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
$ sudo make install

weston

$ sudo pacman -S gegl mtdev
(choose mesa-gl from options for libgl)
$ git clone git://anongit.freedesktop.org/wayland/weston
$ cd weston/
$ CFLAGS="-DMESA_EGL_NO_X11_HEADERS" ./autogen.sh --prefix=/usr/local/ --with-cairo-glesv2 --disable-xwayland --disable-x11-compositor --disable-xwayland-test
$ make
$ sudo make install

Troubleshooting

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

See also