Weston
Weston 是一个 Wayland 合成器,其设计目标是正确性、可靠性、可预测性和性能。
安装
用法
要原生启动 Weston(从 TTY)或在正在运行的 X 会话中运行 Weston
$ weston
有关详细信息和配置标志,请参阅 weston(1)。
演示程序
然后在 Weston 中,您可以运行演示程序。要启动终端模拟器
$ weston-terminal
要在屏幕上移动花朵
$ weston-flower
要显示图像
$ weston-image image1.jpg image2.jpg...
快捷键
Super
键(Windows 键)可以更改,请参阅 weston.ini命令 | 操作 |
---|---|
Ctrl+Alt+Backspace
|
退出 Weston |
Super+Scroll (或 PageUp /PageDown ) |
桌面缩放 |
Super+Tab
|
切换窗口 |
Super+LMB
|
移动窗口 |
Super+MMB
|
旋转窗口 |
Super+RMB
|
调整窗口大小 |
Super+Alt+Scroll
|
更改窗口不透明度 |
Super+k
|
强制杀死活动窗口 |
Super+Up/Down
|
切换上/下工作区 |
Super+Shift+Up/Down
|
抓取当前窗口并切换工作区 |
Super+Fn
|
切换到工作区 n (例如 F2) |
Super+s
|
截取屏幕截图 |
Super+r
|
录制屏幕录像 |
配置
以下是一个配置文件的示例。有关更多信息,请参阅 weston.ini(5)。
~/.config/weston.ini
[core] # xwayland support xwayland=true [libinput] enable-tap=true [shell] #background-image=/usr/share/backgrounds/gnome/Aqua.jpg background-type=scale-crop background-color=0xff000000 #background-color=0xff002244 #panel-color=0x90ff0000 panel-color=0x00ffffff panel-position=bottom #clock-format=none #animation=zoom #startup-animation=none close-animation=none focus-animation=dim-layer #binding-modifier=ctrl num-workspaces=6 locking=false cursor-theme=Adwaita 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 # for Laptop displays [output] name=LVDS1 mode=preferred #mode=1680x1050 #transform=rotate-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-rotate-270 # on screen keyboard input method #[input-method] #path=/usr/lib/weston/weston-keyboard [keyboard] keymap_rules=evdev #keymap_layout=us,de #keymap_variant=colemak, #keymap_options=grp:shifts_toggle #keymap_options=caps:ctrl_modifier,shift:both_capslock_cancel repeat-rate=30 repeat-delay=300 # keymap_options from /usr/share/X11/xkb/rules/base.lst #numlock-on=true [terminal] font=monospace font-size=18 [launcher] icon=/usr/share/weston/icon_flower.png path=/usr/bin/weston-flower [launcher] icon=/usr/share/icons/gnome/32x32/apps/utilities-terminal.png path=/usr/bin/weston-terminal --shell=/usr/bin/bash #[launcher] #icon=/usr/share/icons/gnome/32x32/apps/utilities-terminal.png #path=/usr/bin/gnome-terminal [launcher] icon=/usr/share/icons/hicolor/32x32/apps/firefox.png path=MOZ_ENABLE_WAYLAND=1 /usr/bin/firefox #[launcher] #icon=/usr/share/icons/Adwaita/32x32/apps/multimedia-volume-control.png #path=/usr/bin/st alsamixer -c0
最小 weston.ini
~/.config/weston.ini
[core] xwayland=true [keyboard] keymap_layout=gb [output] name=LVDS1 mode=1680x1050 transform=rotate-90 [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
显示器
Weston 的输出与 xorg.conf
显示器略有不同
$ ls /sys/class/drm
card0 card0-VGA-1 card1 card1-DVI-I-1 card1-HDMI-A-1 card1-VGA-2
card0
是未使用的内置视频适配器。附加适配器 card1
连接到一个 HDMI 和一个 DVI 显示器,因此输出名称为 HDMI-A-1
和 DVI-I-1
。
Xwayland
有关详细信息和可用软件包的概述,请参阅 Wayland#Xwayland。
设置以下内容以激活 Xwayland 的使用
~/.config/weston.ini
[core] xwayland=true
高 DPI 显示器
~/.config/weston.ini
[output] name=... scale=2
Shell 字体
Weston 使用默认的无衬线字体作为窗口标题栏、时钟等。有关如何更改此字体的说明,请参阅 字体配置#设置默认或后备字体。
技巧与窍门
屏幕录制
Weston 具有内置的屏幕录制功能,可以通过按 Super
+r
组合键启动和停止。屏幕录像将保存到 Weston 当前工作目录中的文件 capture.wcap
。WCAP 格式是 Weston 特有的无损视频格式,仅记录帧中的差异。为了能够播放录制的屏幕录像,需要将 WCAP 文件转换为媒体播放器可以理解的格式。首先,将捕获转换为 YUV 像素格式
$ wcap-decode --yuv4mpeg2 capture.wcap > capture.y4m
然后可以使用 FFmpeg 或 x264 将 YUV 文件转码为其他格式(有关更多信息,请参阅 x264 -h
)。
窗口切换
要使用 Super+Space
而不是 Super+Tab
切换窗口,请在 desktop-shell/shell.c
中将 KEY_TAB
更改为 KEY_SPACE
并重新编译 weston。
触摸显示器映射
触摸显示器映射可以通过使用 udev 规则来实现。就像 WL_SEAT
或 ID_SEAT
设备环境变量将设备绑定到指定席位一样,WL_OUTPUT
变量可以用于将设备绑定到适当的输出。此变量应与显示器名称匹配。有关显示器命名约定的说明,请参阅 #显示器。