Sway: Difference between revisions
(to work with gallium, crocus is needed for older graphics) |
(firefox screensharing support, hidpi) |
||
Line 1: | Line 1: | ||
[http://swaywm.org Sway] is a tiling [[Wayland]] compositor. It's a drop-in replacement for the i3 window manager. | [http://swaywm.org Sway] is a tiling [[Wayland]] compositor. It's a drop-in replacement for the i3 window manager. | ||
== | == Installation == | ||
eudev: | |||
<pre> | <pre> | ||
Line 10: | Line 10: | ||
</pre> | </pre> | ||
Graphics drivers: | |||
* [[Intel Video]] | * [[Intel Video]] | ||
* [[Radeon Video]] | * [[Radeon Video]] | ||
Add | Add user to the input and video groups: | ||
<pre> | <pre> | ||
Line 30: | Line 22: | ||
</pre> | </pre> | ||
Install some TTF fonts: | Install some TTF fonts: | ||
Line 38: | Line 29: | ||
</pre> | </pre> | ||
seatd daemon: | |||
<pre> | <pre> | ||
# apk add seatd | # apk add seatd | ||
Line 51: | Line 38: | ||
</pre> | </pre> | ||
[[elogind]], optional for suspend on lid close support. | |||
Install sway: | |||
<pre> | <pre> | ||
Line 88: | Line 47: | ||
xwayland \ # recommended for compatibility reasons | xwayland \ # recommended for compatibility reasons | ||
foot \ # default terminal emulator | foot \ # default terminal emulator | ||
wofi \ # wayland menu for application selection and screensharing | |||
swaylock | swaylock swaylockd \ # lockscreen tool | ||
swaybg \ # wallpaper daemon | swaybg \ # wallpaper daemon | ||
swayidle # idle management (DPMS) daemon | swayidle # idle management (DPMS) daemon | ||
</pre> | </pre> | ||
Configure XDG_RUNTIME_DIR. Add the following to shell init scripts, for the default ash shell it is ~/.profile: | |||
<pre> | <pre> | ||
$ XDG_RUNTIME_DIR= | if test -z "${XDG_RUNTIME_DIR}"; then | ||
export XDG_RUNTIME_DIR=/tmp/$(id -u)-runtime-dir | |||
if ! test -d "${XDG_RUNTIME_DIR}"; then | |||
mkdir "${XDG_RUNTIME_DIR}" | |||
chmod 0700 "${XDG_RUNTIME_DIR}" | |||
fi | |||
fi | |||
</pre> | </pre> | ||
Launch Sway with dbus support: | |||
<pre> | <pre> | ||
dbus-launch --exit-with-session sway | |||
</pre> | </pre> | ||
== Launching program under Wayland == | |||
For some programs, additional configuration is needed to launch them natively under Wayland and to support special features such as screen sharing. | |||
To launch Firefox natively under Wayland and to enable support for screensharing, you need: | |||
* Install and configure [[PipeWire]] | |||
* Install xdg-desktop-portal and xdg-desktop-portal-wlr package | |||
* Install wofi for screen selection | |||
* Launch support programs on sway startup: Add <code>exec pipewire</code> and <code>/usr/libexec/xdg-desktop-portal-wlr</code> to ~/.config/sway/config | |||
* Export the following variables: | |||
<pre> | <pre> | ||
export MOZ_ENABLE_WAYLAND="1" | |||
export XDG_CURRENT_DESKTOP=sway | |||
export XDG_SESSION_TYPE=wayland | |||
</pre> | </pre> | ||
== HiDPI == | |||
<pre> | <pre> | ||
# for GTK-based programs such as firefox and emacs: | |||
export GDK_DPI_SCALE=2 | |||
# for QT-based programs | |||
export QT_WAYLAND_FORCE_DPI="physical" | |||
export QT_QPA_PLATFORM="wayland-egl" | |||
</pre> | </pre> | ||
For additional information, start at <code>man 5 sway</code> and read the [https://github.com/swaywm/sway/wiki upstream | == Configuration == | ||
An example config is provided at <code>/etc/sway/config</code>. Copy it to <code>~/.config/sway/config</code> and read through it to learn the default keybindings. | |||
For additional information, start at <code>man 5 sway</code> and read the [https://github.com/swaywm/sway/wiki upstream wiki]. | |||
[[Category:Desktop]] | [[Category:Desktop]] |
Revision as of 15:55, 21 July 2022
Sway is a tiling Wayland compositor. It's a drop-in replacement for the i3 window manager.
Installation
eudev:
# apk add eudev # setup-udev
Graphics drivers:
Add user to the input and video groups:
# adduser $USER input # adduser $USER video
Install some TTF fonts:
# apk add ttf-dejavu
seatd daemon:
# apk add seatd # rc-update add seatd # rc-service seatd start # adduser $USER seat
elogind, optional for suspend on lid close support.
Install sway:
# apk add sway sway-doc # apk add \ # Install optional dependencies: xwayland \ # recommended for compatibility reasons foot \ # default terminal emulator wofi \ # wayland menu for application selection and screensharing swaylock swaylockd \ # lockscreen tool swaybg \ # wallpaper daemon swayidle # idle management (DPMS) daemon
Configure XDG_RUNTIME_DIR. Add the following to shell init scripts, for the default ash shell it is ~/.profile:
if test -z "${XDG_RUNTIME_DIR}"; then export XDG_RUNTIME_DIR=/tmp/$(id -u)-runtime-dir if ! test -d "${XDG_RUNTIME_DIR}"; then mkdir "${XDG_RUNTIME_DIR}" chmod 0700 "${XDG_RUNTIME_DIR}" fi fi
Launch Sway with dbus support:
dbus-launch --exit-with-session sway
Launching program under Wayland
For some programs, additional configuration is needed to launch them natively under Wayland and to support special features such as screen sharing.
To launch Firefox natively under Wayland and to enable support for screensharing, you need:
- Install and configure PipeWire
- Install xdg-desktop-portal and xdg-desktop-portal-wlr package
- Install wofi for screen selection
- Launch support programs on sway startup: Add
exec pipewire
and/usr/libexec/xdg-desktop-portal-wlr
to ~/.config/sway/config - Export the following variables:
export MOZ_ENABLE_WAYLAND="1" export XDG_CURRENT_DESKTOP=sway export XDG_SESSION_TYPE=wayland
HiDPI
# for GTK-based programs such as firefox and emacs: export GDK_DPI_SCALE=2 # for QT-based programs export QT_WAYLAND_FORCE_DPI="physical" export QT_QPA_PLATFORM="wayland-egl"
Configuration
An example config is provided at /etc/sway/config
. Copy it to ~/.config/sway/config
and read through it to learn the default keybindings.
For additional information, start at man 5 sway
and read the upstream wiki.