Sway
- Sway
sway
- Tiling Wayland compositor
- Developer:Drew DeVault (SirCmpwn)
- License:MIT License
- Website:
Sway is a tiling Wayland compositor and a drop-in replacement for the i3 window manager for X11.
- Tiling Wayland compositor
- Drop-in replacement for the i3 window manager for X11
- It works with your existing i3 configuration and supports most of i3's features, plus a few extras
- and more...
Installation
Installing Sway will also pull other recommended packages such as sway-branding-upstream
or patterns-sway-sway
which is an opinionated set of packages that hopefully makes the Sway window manager work out of the box. The command to install Sway is
sudo zypper in sway
By default sway
package comes with default upstream branding, there is also openSUSE branding for it. Sway is the dependency for openSUSE branding, so it could be installed all together by executing:
sudo zypper in sway-branding-openSUSE
Configuration
Sway wiki describes configuration in details.
To start from community defaults (if there is a need to change defaults):
mkdir -p ~/.config/sway cp /etc/sway/config ~/.config/sway/ $EDITOR ~/.config/sway/config
If config already exists copy it to the ~/.config/sway/
. Good practice is to use dotfiles, more details could be found here: Manage your dotfiles with Git.
Now it could be used it by running:
sway
Some info how to use it with login manager is bellow and in Sway wiki.
Login managers
Login managers might work but they aren't officially supported PR#3634.
Sway package installs /usr/share/wayland-sessions/sway.desktop
and if installed login manager supports Wayland sessions, it should be possible to login into Sway.
Login managers that support Wayland sessions:
- GDM
- SDDM currently could run only under X11, but supports Wayland sessions. Support to add Wayland natively is tracked in PR #440.
- LightDM has Wayland support as well.
- greetd has wlgreet greeter for Wayland.
Application launcher
To launch application $menu
variable could be set in Sway config file to run a launcher that would provide menu to the user and launch the application.
For example in ~/.config/sway/config
setup wofi as a launcher set $menu wofi
.
Install needed application first, please refer to the instructions bellow.
zypper in dmenu
Edit sway config file, for example vi ~/.config/sway/config
:
# Your preferred application launcher # Note: pass the final command to swaymsg so that the resulting window can be opened # on the original workspace that the command was run on. set $menu dmenu_path | dmenu -nb '#173f4f' -sb '#35b9ab' -nf '#73ba25' -sf '#173f4f' -fn 'Source Sans Pro-14' | xargs swaymsg exec --
fzf
zypper in fzf alacritty
Edit sway config file, for example vi ~/.config/sway/config
:
set $menu alacritty --class 'launcher' --command bash -c 'compgen -c | sort -u | fzf --no-info --color="bg:#173f4f,fg:#35b9ab,bg+:#68cbc0,fg+:#516f7b,pointer:#173f4f,hl+:#173f4f,hl:#73ba25" | xargs -r swaymsg -t command exec' for_window [app_id="^launcher$"] floating enable, border none, resize set width 400 px height 100 px, move position center
Fuzzel
Fuzzel
is an application launcher for wlroots based Wayland compositors, similar to rofi's drun mode
zypper in fuzzel
Edit sway config file, for example vi ~/.config/sway/config
:
set $menu fuzzel
wofi
Note: This project is currently not actively maintained.
zypper in wofi
Edit sway config file, for example vi ~/.config/sway/config
:
set $menu wofi
More info about configuration and style could be found here:
Managing Monitors
Get the list of monitors
swaymsg -t get_outputs
Kanshi is a tool which helps managing multiple monitors
zypper in kanshi