- Saved searches
- Use saved searches to filter your results more quickly
- License
- swaywm/sway
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
- About
- Linux — Sway
- Installation
- Configuration
- ~/.config/sway/config
- ~/.config/sway/wofi.conf
- ~/.config/sway/waybar.style.css
- Startup
- KDE Applications
- Installation
- What is Sway?
- Installation
- Configuration
- From i3
- From scratch
- Display configuration
- Brightness
- Troubleshooting
- Running programs natively under Wayland
- GTK3
- Qt5
- Issues with Java applications
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
i3-compatible Wayland compositor
License
swaywm/sway
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Same as 92244c8 ("swaybar: handle wayland-cursor failures") but for swaynag. Closes: #7671
Git stats
Files
Failed to load latest commit information.
README.md
sway is an i3-compatible Wayland compositor. Read the FAQ. Join the IRC channel (#sway on irc.libera.chat).
Releases are signed with E88F5E48 and published on GitHub.
Sway is available in many distributions. Try installing the «sway» package for yours.
Check out this wiki page if you want to build the HEAD of sway and wlroots for testing or development.
- meson *
- wlroots
- wayland
- wayland-protocols *
- pcre2
- json-c
- pango
- cairo
- gdk-pixbuf2 (optional: system tray)
- scdoc (optional: man pages) *
- git (optional: version info) *
meson build/ ninja -C build/ sudo ninja -C build/ install
On systems without logind nor seatd, you need to suid the sway binary:
sudo chmod a+s /usr/local/bin/sway
Sway will drop root permissions shortly after startup.
If you already use i3, then copy your i3 config to ~/.config/sway/config and it’ll work out of the box. Otherwise, copy the sample configuration file to ~/.config/sway/config . It is usually located at /etc/sway/config . Run man 5 sway for information on the configuration.
Run sway from a TTY. Some display managers may work but are not supported by sway (gdm is known to work fairly well).
About
i3-compatible Wayland compositor
Linux — Sway
Sway is a tiling compositor based on Wayland. It can be identified as a counterpart of i3 in Wayland, and as resource saving and lightweight as i3. Even, sway has a completely compatible configuration to i3.
Sway’s core components and necessary applications can be simply installed and configured, e.g.,
- sway : core components
- swaylock : a screen locker
- swayidle : an idle management daemon
- foot : a native terminal in wayland
- rofi : an application launcher and window switcher
- waybar : a bar utility in wayland
- light : a backlight controller
- mako : a notification daemon
- grim : a screenshot utility
- slurp : a region selection utility in wayland
- swaybg : a background setting utility
Installation
pacman -S sway swaylock swayidle foot rofi waybar light mako grim slurp swaybg
Configuration
For centralized management, the configuration files can be gathered in directory ~/.config/sway .
~/.config/sway/config
# Default config for sway # # Copy this to ~/.config/sway/config and edit it to your liking. # # Read `man 5 sway` for a complete reference. ### Variables set $mod Mod4 set $term /usr/bin/foot --font=monospace:size=12 set $menu /usr/bin/wofi -c ~/.config/sway/wofi.conf set $wallpaper /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png set $locker swaylock -f -i $wallpaper ### Appearance and behavior font pango: Source Code Pro 18 workspace_layout default default_border none default_floating_border pixel popup_during_fullscreen smart focus_follows_mouse no ### Output output eDP-1 bg $wallpaper fill output DP-1 bg $wallpaper fill scale 2 ### Idle configuration exec swayidle -w \ timeout 300 $locker \ timeout 600 'swaymsg "output * dpms off"' \ resume 'swaymsg "output * dpms on"' \ before-sleep $locker ### Key bindings # # Basics: # # start a terminal bindsym $mod+Return exec $term # kill focused window bindsym $mod+q kill # start your launcher bindsym $mod+d exec $menu # Drag floating windows by holding down $mod and left mouse button. # Resize them with right mouse button + $mod. # Despite the name, also works for non-floating windows. # Change normal to inverse to use left mouse button for resizing and right # mouse button for dragging. floating_modifier $mod normal # reload the configuration file bindsym $mod+Shift+c reload # # Moving around: # # Move your focus around bindsym $mod+o focus next bindsym $mod+Left focus left bindsym $mod+Down focus down bindsym $mod+Up focus up bindsym $mod+Right focus right # Move the focused window with the same, but add Shift bindsym $mod+Shift+Left move left bindsym $mod+Shift+Down move down bindsym $mod+Shift+Up move up bindsym $mod+Shift+Right move right # # Workspaces: # # define names for workspaces set $ws1 "1" set $ws2 "2" set $ws3 "3" set $ws4 "4" set $ws5 "5" set $ws6 "6" set $ws7 "7" set $ws8 "8" set $ws9 "9" # switch to workspace bindsym $mod+1 workspace $ws1 bindsym $mod+2 workspace $ws2 bindsym $mod+3 workspace $ws3 bindsym $mod+4 workspace $ws4 bindsym $mod+5 workspace $ws5 bindsym $mod+6 workspace $ws6 bindsym $mod+7 workspace $ws7 bindsym $mod+8 workspace $ws8 bindsym $mod+9 workspace $ws9 # move focused container to workspace bindsym $mod+Shift+1 move container to workspace $ws1 bindsym $mod+Shift+2 move container to workspace $ws2 bindsym $mod+Shift+3 move container to workspace $ws3 bindsym $mod+Shift+4 move container to workspace $ws4 bindsym $mod+Shift+5 move container to workspace $ws5 bindsym $mod+Shift+6 move container to workspace $ws6 bindsym $mod+Shift+7 move container to workspace $ws7 bindsym $mod+Shift+8 move container to workspace $ws8 bindsym $mod+Shift+9 move container to workspace $ws9 # # Layout stuff: # # Split bindsym $mod+h splith bindsym $mod+v splitv # Switch the current container between different layout styles bindsym $mod+s layout stacking bindsym $mod+w layout tabbed bindsym $mod+e layout toggle split # Make the current focus fullscreen bindsym $mod+f fullscreen toggle # Toggle the current focus between tiling and floating mode bindsym $mod+Shift+space floating toggle # Swap focus between the tiling area and the floating area bindsym $mod+space focus mode_toggle # Move focus to the parent container bindsym $mod+u focus parent ### System mode mode "system" < bindsym h exec systemctl poweroff, mode "default" bindsym l exec $locker, mode "default" bindsym r exec systemctl reboot, mode "default" bindsym s exec $locker && systemctl suspend, mode "default" bindsym Return mode "default" bindsym Escape mode "default" >bindsym $mod+Shift+e mode "system" ### Display mode set $mode_display (D)ouble, (M)irror, (I)nternal, (E)xternal mode "$mode_display" < bindsym d exec swaymsg output eDP1 enable DP1 enable, mode "default" bindsym i exec swaymsg output eDP1 enable DP1 disable, mode "default" bindsym e exec swaymsg output eDP1 disable DP1 enable, mode "default" bindsym Return mode "default" bindsym Escape mode "default" >bindsym $mod+Shift+x mode "$mode_display" ### Status Bar: # Read `man 5 sway-bar` for more information about this section. bar < swaybar_command "waybar -c ~/.config/sway/waybar/config -s ~/.config/sway/waybar/style.css" >### Startup exec mako --anchor top-right --default-timeout 6000 exec wl-paste -t text --watch clipman store --no-persist exec fcitx5 -r & ### Screenshot bindsym --release < Print exec grim $(date +'%Y%m%d-%H%M%S.png') Shift+Print exec grim -g "$(slurp)" $(date +'%Y%m%d-%H%M%S.png') >### Keyboard input type:keyboard < xkb_options ctrl:nocaps >### Touchpad of laptop input type:touchpad < dwt enable >### Lid related event for laptop bindswitch < lid:on output eDP-1 disable lid:off output eDP-1 enable >### Special keys for laptop bindsym < # Volume XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5% XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5% XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle # Brightness XF86MonBrightnessUp exec sudo light -A 5 XF86MonBrightnessDown exec sudo light -U 5 >include /etc/sway/config.d/* xwayland enable
~/.config/sway/wofi.conf
mode=drun allow_images=true allow_markup=true location=center lines=9 filter_rate=1 term=termite key_up=Control_L-p key_down=Control_L-n key_exit=Control_L-g no_actions=true width=300 image_size=32
~/.config/sway/waybar.style.css
* < border: none; border-radius: 0; font-family: Roboto, Helvetica, Arial, sans-serif; font-size: 18px; min-height: 0; >window#waybar < background-color: rgba(43, 48, 59, 0.5); border-bottom: 3px solid rgba(100, 114, 125, 0.5); color: #ffffff; transition-property: background-color; transition-duration: .5s; >window#waybar.hidden < opacity: 0.3; >/* window#waybar.empty < background-color: transparent; >window#waybar.solo < background-color: #FFFFFF; >*/ window#waybar.termite < background-color: #3F3F3F; >window#waybar.chromium < background-color: #000000; border: none; >#workspaces button < padding: 0 5px; background-color: transparent; color: #ffffff; border-bottom: 3px solid transparent; >/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ #workspaces button:hover < background: rgba(0, 0, 0, 0.2); box-shadow: inherit; border-bottom: 3px solid #ffffff; >#workspaces button.focused < background-color: #64727D; border-bottom: 3px solid #ffffff; >#workspaces button.urgent < background-color: #eb4d4b; >#mode < background-color: #64727D; border-bottom: 3px solid #ffffff; >#clock, #battery, #cpu, #memory, #temperature, #backlight, #network, #pulseaudio, #custom-media, #tray, #mode, #idle_inhibitor < padding: 0 10px; margin: 0 0px; color: #ffffff; >#clock < background-color: #64727D; >#battery < background-color: #ffffff; color: #000000; >#battery.charging < color: #ffffff; background-color: #26A65B; >@keyframes blink < to < background-color: #ffffff; color: #000000; >> #battery.critical:not(.charging) < background-color: #f53c3c; color: #ffffff; animation-name: blink; animation-duration: 0.5s; animation-timing-function: linear; animation-iteration-count: infinite; animation-direction: alternate; >label:focus < background-color: #000000; >#cpu < background-color: #2ecc71; color: #000000; >#memory < background-color: #9b59b6; >#backlight < background-color: #90b1b1; >#network < background-color: #2980b9; >#network.disconnected < background-color: #f53c3c; >#pulseaudio < background-color: #f1c40f; color: #000000; >#pulseaudio.muted < background-color: #90b1b1; color: #2a5c45; >#custom-media < background-color: #66cc99; color: #2a5c45; min-width: 100px; >#custom-media.custom-spotify < background-color: #66cc99; >#custom-media.custom-vlc < background-color: #ffa000; >#temperature < background-color: #f0932b; >#temperature.critical < background-color: #eb4d4b; >#tray < background-color: #2980b9; >#idle_inhibitor < background-color: #2d3436; >#idle_inhibitor.activated < background-color: #ecf0f1; color: #2d3436; >#mpd < background-color: #66cc99; color: #2a5c45; >#mpd.disconnected < background-color: #f53c3c; >#mpd.stopped < background-color: #90b1b1; >#mpd.paused
Startup
After the installation and configuration, sway can be started by running command sway from a TTY after login.
KDE Applications
There are a rich number of applications dedicated for KDE, e.g., file manager dolphin and PDF reader okular . On sway , they can be installed and configured as follows.
Installation
What is Sway?
The Sway Window Manager is a tiling Wayland compositor and a 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.
Sway is not available as an option in the Debian Installer but can be added post-installation in Debian 11/Bullseye and newer.
Sway does not support the proprietary NVIDIA drivers in any form.
Installation
Installing Sway from the repos in Debian 11 and newer is often as easy as typing:
- sway-backgrounds — This package contains a set of desktop backgrounds that come with Sway.
- swaybg — Sway’s wallpaper utility for Wayland compositors.
- swayidle — Sway’s idle management daemon. swayidle listens for idle activity on your Wayland compositor and executes tasks on various idle-related events.
- swaylock — Sway’s screenlocking utility for Wayland.
- xdg-desktop-portal-wlr — Support for the screenshot, screencast, and possibly remote-desktop.
- xwayland — Support for Xwayland apps
At this step, do not start your session on Sway as you will most likely be stuck. Configure it first.
Configuration
From i3
If you’re coming from i3, it’s best to read the brief official i3 migration guide.
To migrate existing i3 files:
$ mkdir ~/.config/sway $ cp ~/.config/i3/config ~/.config/sway/config $ cat ~.Xresources >> ~/.Xdefaults
You also need to have your keyboard layout information. This can help:
Add something like this in your ~/.config/sway/config file:
input * xkb_layout "us,de,ru" input * xkb_variant "colemak,,typewriter" input * xkb_options "grp:win_space_toggle" input "MANUFACTURER1 Keyboard" xkb_model "pc101" input "MANUFACTURER2 Keyboard" xkb_model "jp106"
You probably also want this in your Sway configuration file:
When it’s done, you can disconnect yourself from your i3 session and log back to Sway.
From scratch
To begin configuring sway, copy the sample configuration file located at /etc/sway/config to ~/.config/sway/config.
$ mkdir -p ~/.config/sway $ cp /etc/sway/config ~/.config/sway/ $ nano ~/.config/sway/config
Display configuration
To organize your screens, start by running the command swaymsg -t get_outputs to get a list of output names.
Then, use the ‘output’ command in sway’s config file with the desired output identifier to configure display options, as shown in the example below:
output # . config options. mode 2560x1080@74.991Hz pos 0,0 > # laptop display example output eDP-1 mode 1366x768 position 2560,0 >
Make sure to check the available modes for each monitor using the output list obtained earlier.
For detailed information, check sway-output manual.
Brightness
You can use brightnessctl or light to control the brightness
bindsym XF86MonBrightnessUp exec light -A 5 bindsym XF86MonBrightnessDown exec light -U 5
Example with brightnessctl
bindsym XF86MonBrightnessUp exec brightnessctl set 5%+ bindsym XF86MonBrightnessDown exec brightnessctl set 5%-
The best reference for configuring Sway from scratch can be found on their official wiki: https://github.com/swaywm/sway/wiki
Troubleshooting
Running programs natively under Wayland
There are several ways to configure the necessary environment variables to run your apps natively, without Xwayland. Depending on your preferences and setup, you can choose one of the following alternatives: add the variables to your launcher script, export them in your ~/.bashrc file, place them in the /etc/environment file, or include them in a session file if you’re using a display manager.
GTK3
Wayland will be selected by default. Do not set GDK_BACKEND, it will break apps (e.g. Chromium and Electron).
Firefox: Experimental Wayland support in Firefox can be enabled with MOZ_ENABLE_WAYLAND=1
LibreOffice: If Wayland wasn’t used by default, try enabling it with SAL_USE_VCLPLUGIN=gtk3
Qt5
To enable Wayland support, you might need qtwayland5 package.
When using a display manager, Wayland is used by default if XDG_SESSION_TYPE=wayland is set. If you’re not using a display manager, set QT_QPA_PLATFORM=wayland-egl.
Issues with Java applications
Try to set _JAVA_AWT_WM_NONREPARENTING=1