Weston
Weston 是一个 Wayland 合成器,旨在实现正确性、可靠性、可预测性和高性能。
安装
用法
要在 TTY 中原生启动 Weston,或者在正在运行的 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 变量可用于将设备绑定到相应的输出。此变量应与监视器名称匹配。有关监视器命名约定,请参阅 #显示器。