← 返回命令列表

Linux command

sway 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Start sway

sway

Start with a custom configuration file

sway --config [path/to/config]

Validate the configuration file

sway --validate

Start with verbose logging

sway --verbose

Start with debug logging

sway --debug

Get the IPC socket path

sway --get-socketpath

说明

sway is a tiling Wayland compositor and a drop-in replacement for the i3 window manager for X11. It works with existing i3 configuration files and supports most i3 features while running natively on Wayland. Sway can be launched directly from a TTY or via a Wayland-compatible display manager. The configuration file is typically located at ~/.config/sway/config, with the default template at /etc/sway/config. Sway communicates with clients via an IPC socket specified in the SWAYSOCK environment variable. The compositor uses wlroots as its Wayland library and supports features like multiple outputs, workspaces, floating and tiling layouts, keyboard and mouse bindings, and integration with status bars like waybar and swaybar.

参数

-c, --config _file_
Use an alternative configuration file instead of the default (~/.config/sway/config).
-C, --validate
Check the configuration file for syntax errors without starting the compositor.
-d, --debug
Enable full logging, including debug information.
-V, --verbose
Enable more verbose logging.
--get-socketpath
Get the IPC socket path, print it, and exit.
--unsupported-gpu
Allow running on unsupported GPUs (required for NVIDIA with driver 495+).
-v, --version
Show the version number and exit.
-h, --help
Show help message and exit.

FAQ

What is the sway command used for?

sway is a tiling Wayland compositor and a drop-in replacement for the i3 window manager for X11. It works with existing i3 configuration files and supports most i3 features while running natively on Wayland. Sway can be launched directly from a TTY or via a Wayland-compatible display manager. The configuration file is typically located at ~/.config/sway/config, with the default template at /etc/sway/config. Sway communicates with clients via an IPC socket specified in the SWAYSOCK environment variable. The compositor uses wlroots as its Wayland library and supports features like multiple outputs, workspaces, floating and tiling layouts, keyboard and mouse bindings, and integration with status bars like waybar and swaybar.

How do I run a basic sway example?

Run `sway` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -c, --config _file_ do in sway?

Use an alternative configuration file instead of the default (~/.config/sway/config).