Weston

提供: ArchWiki
2022年1月15日 (土) 18:07時点におけるKgx (トーク | 投稿記録)による版 (参照の項目を追加)
ナビゲーションに移動 検索に移動

Weston は Wayland コンポジタのリファレンス実装です。

インストール

weston パッケージをインストールしてください。

使用方法

Weston をインストールしたのなら Wayland をテストする環境が整っているはずです。

Weston を起動するには次のようにします。起動中の X セッションの中からでも、TTY 中から (ネイティブ) でも実行できます:

$ weston

デモアプリケーション

Weston の TTY からデモを実行できます。ターミナルエミュレータを起動するには:

$ weston-terminal

画面に花を散らすには:

$ weston-flower 

画像を表示するには:

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

ショートカット

ヒント: Super (windows キー) は変更可能です。こちらを参照 weston.ini
キーボードショートカット
コマンド アクション
Ctrl+Alt+Backspace Weston を閉じる
Super+Scroll (or 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 スクリーンキャストを録画する

設定

キーボードレイアウト・モジュール・UI の設定ファイルの例です。詳しくは weston.ini(5) を見て下さい。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-1DVI-I-1 です。

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

# 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=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 モニタを1台ずつケーブルで接続しているので、出力名は HDMI-A-1DVI-I-1 となっています。

XWayland

詳細と利用可能なパッケージの概要については、Wayland#XWayland を参照してください。

XWayland の使用を有効にするには、以下の config キーを設定します。

~/.config/weston.ini
[core]
xwayland=true
ノート: X を設定していない場合、キーマップの設定が必要です: Xorg でのキーボード設定

HiDPI ディスプレイ

Retina または HiDPI のディスプレイでは以下を使用してください:

~/.config/weston.ini
[output]
name=...
scale=2

シェルのフォント

Weston はウィンドウのタイトルバーや時計などにデフォルトの sans-serif フォントを使用します。フォントを変更する方法はフォント設定#フォントの置き換えを見て下さい。

ヒントとテクニック

スクリーンキャスト録画

Weston にはスクリーンキャスト機能が備わっており、Super+r キーを押すことで録画を開始・停止することができます。スクリーンキャストは Weston のカレントディレクトリ内の capture.wcap ファイルに保存されます。

WCAP ファイルは Weston 専用のロスレス動画フォーマットで、フレーム間の差異だけを記録しています。記録されたスクリーンキャストを再生するには、WCAP ファイルをメディアプレイヤーが再生できるフォーマットに変換する必要があります。まず、録画した動画を YUV ピクセル形式に変換してください:

$ wcap-decode capture.wcap --yuv4mpeg2 > capture.y4m

作成された YUV ファイルは FFmpeg を使うことで他のフォーマットに変換できます。

ウィンドウの切り替え

Super+Space でウィンドウを切り替えるには、 desktop-shell/shell.c 内の KEY_TABKEY_SPACE に変更して weston を再コンパイルしてください。

EGLstream のサポート (Nvidia 専用ドライバ)

参考までに Wayland#要件 をご覧ください。

weston-eglstream パッケージが AUR にあります、特別なパッチが含まれています。

参照