but why copy, baby, why? why, is it alright, baby, why?:
"""
code
Assistant
It seems like you've pasted a detailed configuration and documentation for Sway, which is a popular tiling window manager for Wayland. It includes various sections covering configuration options, keybindings, utilities, output settings, and troubleshooting tips, among others.
If you have specific questions or need clarification about any particular aspect of the Sway configuration, feel free to ask! Whether it’s understanding specific commands, customizing your setup, or resolving issues, I'm here to help.
User
Assistant
It looks like you've shared a significant portion of the Sway window manager's configuration documentation and troubleshooting guide. Sway is a tiling window manager that is intended for Wayland, offering a highly customizable and efficient environment for Linux users.
Why Copy, Baby, Why?
The excerpt reminds one of lyrics from a song, perhaps hinting at the redundancy of copying extensive configurations in a casual manner. Here are a few reasons and contexts for "copying" such extensive configuration details:
User
Assistant
User
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
# 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
#
# Logo key. Use Mod1 for Alt.
set $mod Mod4
# Home row direction keys, like vim
set $left h
set $down j
set $up k
set $right l
# Your preferred terminal emulator
set $term foot
# Your preferred application launcher
set $menu wmenu-run
### Output configuration
#
# Default wallpaper (more resolutions are available in /usr/local/share/backgrounds/sway/)
output * bg /usr/local/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
#
# Example configuration:
#
# output HDMI-A-1 resolution 1920x1080 position 1920,0
#
# You can get the names of your outputs by running: swaymsg -t get_outputs
### Idle configuration
#
# Example configuration:
#
# exec swayidle -w \
# timeout 300 'swaylock -f -c 000000' \
# timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
# before-sleep 'swaylock -f -c 000000'
#
# This will lock your screen after 300 seconds of inactivity, then turn off
# your displays after another 300 seconds, and turn your screens back on when
# resumed. It will also lock your screen before your computer goes to sleep.
### Input configuration
#
# Example configuration:
#
# input "2:14:SynPS/2_Synaptics_TouchPad" {
# dwt enabled
# tap enabled
# natural_scroll enabled
# middle_emulation enabled
# }
#
# You can get the names of your inputs by running: swaymsg -t get_inputs
# Read `man 5 sway-input` for more information about this section.
### Key bindings
#
# Basics:
#
# Start a terminal
bindsym $mod+Return exec $term
# Kill focused window
bindsym $mod+Shift+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
# Exit sway (logs you out of your Wayland session)
bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'
#
# Moving around:
#
# Move your focus around
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
# Or use $mod+[up|down|left|right]
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
# Ditto, with arrow keys
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:
#
# Switch to workspace
bindsym $mod+1 workspace number 1
bindsym $mod+2 workspace number 2
bindsym $mod+3 workspace number 3
bindsym $mod+4 workspace number 4
bindsym $mod+5 workspace number 5
bindsym $mod+6 workspace number 6
bindsym $mod+7 workspace number 7
bindsym $mod+8 workspace number 8
bindsym $mod+9 workspace number 9
bindsym $mod+0 workspace number 10
# Move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number 1
bindsym $mod+Shift+2 move container to workspace number 2
bindsym $mod+Shift+3 move container to workspace number 3
bindsym $mod+Shift+4 move container to workspace number 4
bindsym $mod+Shift+5 move container to workspace number 5
bindsym $mod+Shift+6 move container to workspace number 6
bindsym $mod+Shift+7 move container to workspace number 7
bindsym $mod+Shift+8 move container to workspace number 8
bindsym $mod+Shift+9 move container to workspace number 9
bindsym $mod+Shift+0 move container to workspace number 10
# Note: workspaces can have any name you want, not just numbers.
# We just use 1-10 as the default.
#
# Layout stuff:
#
# You can "split" the current object of your focus with
# $mod+b or $mod+v, for horizontal and vertical splits
# respectively.
bindsym $mod+b 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 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+a focus parent
#
# Scratchpad:
#
# Sway has a "scratchpad", which is a bag of holding for windows.
# You can send windows there and get them back later.
# Move the currently focused window to the scratchpad
bindsym $mod+Shift+minus move scratchpad
# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
bindsym $mod+minus scratchpad show
#
# Resizing containers:
#
mode "resize" {
# left will shrink the containers width
# right will grow the containers width
# up will shrink the containers height
# down will grow the containers height
bindsym $left resize shrink width 10px
bindsym $down resize grow height 10px
bindsym $up resize shrink height 10px
bindsym $right resize grow width 10px
# Ditto, with arrow keys
bindsym Left resize shrink width 10px
bindsym Down resize grow height 10px
bindsym Up resize shrink height 10px
bindsym Right resize grow width 10px
# Return to default mode
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
#
# Utilities:
#
# Special keys to adjust volume via PulseAudio
bindsym --locked XF86AudioMute exec pactl set-sink-mute \@DEFAULT_SINK@ toggle
bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume \@DEFAULT_SINK@ -5%
bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume \@DEFAULT_SINK@ +5%
bindsym --locked XF86AudioMicMute exec pactl set-source-mute \@DEFAULT_SOURCE@ toggle
# Special keys to adjust brightness via brightnessctl
bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%-
bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+
# Special key to take a screenshot with grim
bindsym Print exec grim
#
# Status Bar:
#
# Read `man 5 sway-bar` for more information about this section.
bar {
position top
# When the status_command prints a new line to stdout, swaybar updates.
# The default just shows the current date and time.
status_command while date +'%Y-%m-%d %X'; do sleep 1; done
colors {
statusline #ffffff
background #323232
inactive_workspace #32323200 #32323200 #5c5c5c
}
}
include /usr/local/etc/sway/config.d/*
""".Login managers
Some login managers support Wayland, and others don't. If you have issues starting sway and you use a login manager, your first step should be disabling the login manager and running sway as described by man 1 sway. If it does not work, report the bug to your login manager, not to sway.
For a small list of compatible login managers, see the login manager list on the useful addons page.
You can start sway automatically without a login manager, for example, by adding this to your .bash_profile (.zlogin or .zprofile for Zsh):
If running from tty1 start sway
[ "$(tty)" = "/dev/tty1" ] && exec sway
For Fish, create the file ~/.config/fish/conf.d/sway.fish
The suggested location for the sway configuration file is ~/.config/sway/config. To begin configuring sway, create this directory and copy the default config.
Read the default config - it has comments that explain what each option does. Read man 5 sway for more information about each config command.
Display configuration
Sway manages displays for you, xrandr should not be used.
Run swaymsg -t get_outputs to get a list of output names. Then use the output command to arrange your displays.
For detailed information, check the manual. Run man 5 sway-output.
Multihead
Managing multiple monitors is simple through the use of multiple output commands.
e.g., if we want to have a monitor with HDMI1 and a resolution of 1920x1080, and to the right of it a laptop monitor with eDP1 and a resolution of 1600x900; the following two commands can be placed in your config file:
output HDMI1 pos 0 0 res 1920x1080
output eDP1 pos 1920 0 res 1600x900
Take a note that you might want to change the focus of monitor on sway launch. Add this to your sway config:
focus output
or
exec swaymsg focus output
so it doesn't trigger on reload.
For more details read man 5 sway-output.
Clamshell Mode
AKA Closed Display mode. This mode is where your laptop lid is closed and you have external monitor(s) as outputs. As of Sway 1.1 you can use switch events to drive certain functionality, such as disabling an output upon a laptop lid being closed. Pass your laptop output name into the following, which can be found with: swaymsg -t get_outputs for example eDP-1.
set laptop<laptopoutputidentifier>bindswitch−−reload−−lockedlid:onoutputlaptop disable
bindswitch --reload --locked lid:off output $laptop enable
However, when reloading sway while using clamshell mode, the displays may reset (i.e. both displays will be enabled). To stop this, save this shell script:
case "LS"in∗open)swaymsgoutput"LAPTOP_OUTPUT" enable ;;
*closed) swaymsg output "$LAPTOP_OUTPUT" disable ;;
*) echo "Could not get lid state" >&2 ; exit 1 ;;
esac
Replace with the name of the display, ensure lid state file path is correct for your system.
To make sure this script runs whenever Sway is reloaded, add this line to your sway config:
exec_always /path/to/script.sh
HiDPI
HiDPI can be enabled via output and its scale option.
output scale
is the integer scaling factor (usually 2 for HiDPI screens)
If scaling is active, it has to be considered when defining relative positions. For example, if the scaling factor for the left monitor (HDMI1) is 2, the relative position for the right output has to be divided by 2. This example is illustrated by the configuration below:
output HDMI1 scale 2
output HDMI1 pos 0 0 res 3200x1800
output eDP1 pos 1600 0 res 1920x1080
Note that the x-pos of eDP1 is 1600 = 3200/2.
Fractional scaling
Fractional scaling is supported but is not recommended. Your display does not have fractional pixels - and if you enable fractional scaling we cannot display your windows faithfully and your image quality will be degraded, for clients that do not report HiDPI surfaces (including all XWayland clients, but usually does not include modern versions of Wayland-native GUI toolkits). If you use many such programs, you should instead choose the integer scale factor appropriate for your display and configure your software's font size as necessary. If you still want to use fractional scaling, it is as simple as e.g. output scale 1.5.
Display rotation
output transform 90 will rotate output by 90 degrees clockwise. Read man 5 sway-output and search for transform to see other options, like flipping across an axis.
For automatic display rotation via a built-in accelerometer, see rot8.
Redshift equivalent
Redshift adjusts the color temperature of your screen according to your surroundings. This may help your eyes hurt less if you are working in front of the screen at night. Unfortunately, Redshift does not support Wayland.
However, there is a fork of Redshift called gammastep which does have Wayland support. On Arch Linux, it is available as an official package.
Other alternatives are wlsunset, wl-gammarelay and wl-gammarelay-rs.
Input configuration
A list of input devices is available by running swaymsg -t get_inputs. Use the identifier for the device you want to configure in your config file:
input {
# ...config options...
}
Nothing prevents having multiple configurations for different specific devices:
default layout
input "1:1:AT_Translated_Set_2_keyboard" {
xkb_layout us
}
See man 7 xkeyboard-config for options you can use with the xkb_layout, xkb_model, xkb_options, xkb_rules, and xkb_variant commands. Separate multiple options with commas.
User-specific settings such as symbols will be loaded from their respective directories in ~/.xkb/ or $XDG_CONFIG_HOME/xkb/.
A lot of modifications are available through xkb_options. They can be found in /usr/share/X11/xkb/symbols/{altwin,capslock,compose,ctrl} and the respective option name in /usr/share/X11/xkb/rules/base.
Examples:
code
Make caps lock work as escape: xkb_options caps:escape
Swap escape and caps lock: xkb_options caps:swapescape
Make caps lock work as control: xkb_options ctrl:nocaps
Make caps lock work as additional control xkb_options caps:ctrl_modifier
Swap left alt and super, and set caps lock to escape: xkb_options altwin:swap_lalt_lwin,caps:escape
Make the menu key work as additional super: xkb_options altwin:menu_win
Note that to trigger several options, you need to list them separated with a comma, e.g. xkb_options caps:escape,altwin:swap_lalt_lwin; if you instead write several xkb_options-lines, only the last one will take effect.
Load custom xkb keymap file (since #3999)
The full documentation on how to override keymappings is available at this link. Here a slightly digested version with a practical commented example.
Libinput config options
input {
left_handed enabled
tap enabled
natural_scroll disabled
dwt enabled
accel_profile "flat" # disable mouse acceleration (enabled by default; to set it manually, use "adaptive" instead of "flat")
pointer_accel 0.5 # set mouse sensitivity (between -1 and 1)
}
See man 5 sway-input for all available options.
Touch Display Mapping
Touch input targets for touch displays used in a multi-display environment must be mapped to that touch display only.
set display1"DellInc.DELLP2414HVHVTW542165L"setdisplay2 "Dell Inc. DELL P2418HT MYDM775F152L"
set $display2-touch "8146:24835:Melfas_LGD_AIT_Touch_Controller"
input display2−touchmaptooutputdisplay2
Wallpapers
Feh and similar tools do not work on Wayland. Sway supports setting wallpapers if swaybg is installed. You can use this feature through the output command, using the bg option:
e.g. output HDMI-A-1 bg ~/wallpaper.png stretch
See output configuration options in man 5 sway-output.
Swaybar supports most of the same features as i3bar, and is configured in the same way. Add a bar section to your config:
bar {
# ...bar options..
}
For the full list of options, see man 5 sway-bar.
Comments
Comments are supported in the configuration and start with a # character, optionally with whitespace before it. Comments and commands on the same line are not supported, because i3 - and thus Sway - supports the #RRGGBB syntax for specifying colours. Therefore, always place comments on their own line.
Additionally, a commented out line with a trailing backslash currently affects the next line, even if that is not a comment. So, never end a commented line with a backslash .
Taking screenshots
X11 tools like scrot do not work. Try grim.
Grimshot provides a simpler command line interface if you're looking for something more high level (and relies on grim and slurp internally).
shotman is a simple, light, modern UI for screenshooting, also relies on slurp for region selection, and taking screenshot of current active window only works in sway for now.
flameshot has a simple and inituitive GUI with various editing tools.
swappy is another tool (written in C, uses GTK and Pango) that pops up a GUI and allows basic operations on the screenshot such as adding text, arrows, circles, squares and choosing colors. Has a config file to customize the GUI. Can also work without grim.
Try wf-recorder for screen recording of wlroots-based compositors like swaywm. If you use OBS Studio, versions newer than 27.0 natively support screen recording using pipewire. For older versions you can use wlrobs recording plugin for wlroots-based compositors.
bemenu works as a dmenu replacement.
sway-launcher-desktop: TUI Application launcher with Desktop Entry support.
wofi is a rofi-like launcher.
yofi is a minimalistic menu for wayland.
tofi is an extremely performant wlroots-specific launcher.
Not yet possible with swaywm/wlroots. Please look / get involved here.
Setting environmental variables
How you set variables will depend on how sway was started.
Environment variables are inherited from the process that starts sway. You need to set variables there.
Some of the possible options are:
code
login manager: check the documentation.
login shell: export them there before launching sway.
user service: use the EnvironmentFile= key and an environment file.
More details here.
FAQ
Before asking questions...
Update both sway and wlroots and then try again. Look through known issues in sway and known issues in wlroots. Did you read the man pages? Start with man sway. Read your config file, too. And read the log.
How do I get rid of title bars on applications?
Use the default_border command in your config. default_border normal shows title bars, whereas none and pixel do not. The border command operates on the currently focused window only. default_border is a setting, border is an action.
Note that default_border only affects new windows. Even after reloading sway, you will need to close and re-open any windows you do not wish to see the title bar on.
Where are my tray icons?
Initial tray icon support for swaybar was merged with #3249 pull request. Missing features are tracked in #3799.
How do I configure urxvt transparency?
urxvt transparency requires "real transparency" settings. Add this to your .Xresources and reload via xrdb ~/.Xresources:
Be aware that this configuration will conflict with the URxvt.reversevideo and if you enable the reversevideo option, the text will become transparent instead of the background.
You may wish to add exec xrdb ~/.Xresources to your sway config to configure this on startup.
I'm not using logind but still want DBus/PolKit/power management to work.
Alternatively, you could omit the ck-launch-session part.
xbacklight
xbacklight is, as the name would imply, a tool for X. Instead, you can use brightnessctl, brillo or just directly manipulate /sys/class/backlight.
For instance:
bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%-
bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+
Which terminal emulator can I use?
You can use either X- or Wayland-native terminal emulator with little difference in terms of functionality.
Alacritty, Kitty, foot, GhosTTY, or wezterm will use Wayland without additional configuration. You can use VTE-based terminals like GNOME Terminal. X-based urxvt is another popular option.
Why am I getting Error on line XX […] Unknown key?
In your config, you should replace at line XX bindsym by bindcode.
Locale-specific configuration tricks
Workspace switching on the French layout
Because French number keys only produce numbers when Shift is pressed (or Caps Lock is active), you'll need to setup key bindings with the various special characters under the numbers (&, é, ", etc):
code
# Switch to workspace
bindsym $mod+ampersand workspace number 1
bindsym $mod+eacute workspace number 2
bindsym $mod+quotedbl workspace number 3
bindsym $mod+apostrophe workspace number 4
bindsym $mod+parenleft workspace number 5
bindsym $mod+minus workspace number 6
bindsym $mod+egrave workspace number 7
bindsym $mod+underscore workspace number 8
bindsym $mod+ccedilla workspace number 9
bindsym $mod+agrave workspace number 10
# Move focused container to workspace
bindsym $mod+Shift+ampersand move container to workspace number 1
bindsym $mod+Shift+eacute move container to workspace number 2
bindsym $mod+Shift+quotedbl move container to workspace number 3
bindsym $mod+Shift+apostrophe move container to workspace number 4
bindsym $mod+Shift+parenleft move container to workspace number 5
bindsym $mod+Shift+minus move container to workspace number 6
bindsym $mod+Shift+egrave move container to workspace number 7
bindsym $mod+Shift+underscore move container to workspace number 8
bindsym $mod+Shift+ccedilla move container to workspace number 9
bindsym $mod+Shift+agrave move container to workspace number 10
Key bindings on a dual US/Russian layout or US/Greek
If you have configured your keyboard with a US and a Russian layout (input * xkb_layout us,ru), your bindings using Latin script letters won't work when the Russian keyboard is active (for instance, $mod+f won't work, because you can't produce the letter f with the Russian layout).
To make key bindings work regardless of the currently active layout, you can use bindsym --to-code:
bindsym --to-code {
mod+bsplithmod+v splitv
}
Windows/KDE/gnome launcher shortcut
This will toggle the launcher on a single keypress, but not if a keybind was triggered with that key.
If you want your workspace to be moved to the current output when you switch to it using mod+<number>insteadofyoubeingrefocusedtoadifferentoutputwheretheworkspaceiscurrmod+ lines in your configuration with this (for each of course):
bindsym mod+1[workspace="1"] move workspace to output current; workspace number 1
Move all workspace windows
set modemoveallworkspacewindows"Moveallworkspacewindowsto[0−9]?"modemode_move_all_workspace_windows {
bindsym 1 [workspace="."] move to workspace 1; workspace number 1, mode "default"
bindsym 2 [workspace="."] move to workspace 2; workspace number 2, mode "default"
bindsym 3 [workspace="."] move to workspace 3; workspace number 3, mode "default"
bindsym 4 [workspace="."] move to workspace 4; workspace number 4, mode "default"
bindsym 5 [workspace="."] move to workspace 5; workspace number 5, mode "default"
bindsym 6 [workspace="."] move to workspace 6; workspace number 6, mode "default"
bindsym 7 [workspace="."] move to workspace 7; workspace number 7, mode "default"
bindsym 8 [workspace="."] move to workspace 8; workspace number 8, mode "default"
bindsym 9 [workspace="."] move to workspace 9; workspace number 9, mode "default"
bindsym 0 [workspace="."] move to workspace 10; workspace number 10, mode "default"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym mod+shift+ctrl+mmodemode_move_all_workspace_windows
XDG_CURRENT_DESKTOP environment variable is not being set
Some applications and desktop mechanisms may rely on the XDG_CURRENT_DESKTOP environment variable to be set so that the application can accommodate for being ran under sway. Examples include XDG autostart implementations, screensharing in Firefox and many others.
Sway itself does not set this variable, it should be set before sway is started. Sane default would be sway:wlroots (specific sway as first priority, common wlroots after it to be in line with other wlroots compositors). If you start sway from shell profile, export it before sway invocation. If you use a login manager, the login manager will use the DesktopNames attribute inside the sway.desktop file. This file may be modified to add DesktopNames=sway;wlroots (also see #7952).
It's not good practice for applications to make use of XDG_CURRENT_DESKTOP in this way, and Firefox has an issue open to try to fix it. Refer to xpdw's FAQ and xdpw's Troubleshooting guide if your issue is specifically related to screensharing.
Systemd and dbus activation environments
Some variables need to be exported to systemd and/or dbus activation environments so tools that rely on them work properly. The essential ones are: WAYLAND_DISPLAY, DISPLAY (if XWayland is used), XDG_CURRENT_DESKTOP, plus Sway's: SWAYSOCK, I3SOCK, XCURSOR_SIZE, XCURSOR_THEME.
Export should be performed from context of running sway process, via exec statements in sway's configuration:
We will expect three things from you: your sway version, your config file, and a debug log. Obtain your version like so:
swaymsg -t get_version
If this doesn't work, use:
sway -v
Obtain a debug log like so:
sway -d 2> ~/sway.log
This will record information about sway's activity when it's running. Briefly reproduce your problem and exit sway. Upload this file, along with your config, to gist.github.com, and include this in a GitHub issue (or when asking for help on IRC). When preparing a debug log, make it brief - start up sway, do the minimum work necessary to reproduce the error, then close sway. Explain the steps you took in plain English in your GitHub issue as well.
If the problem isn't immediately obvious, you will likely be required to debug it yourself - we are volunteers and only have so much free time.
I just installed sway. I can move my mouse cursor but my keyboard does not work.
Are you pressing keys that are bound to do anything? Read the config file. If mod+Returnisboundtoexecfoot(whichitisbydefault)−doyouhavefootinstalled?Trymod+2 or $mod+8 - does it switch workspaces?
I can't run anything.
Check for keyboard shortcuts in the config file to start your launcher. Are you trying to run x applications? You probably don't have xwayland installed. Consult your distribution's documentation for instructions on installing xwayland.
My keyboard shortcuts do not work.
If you're running sway on top of X11, with i3 running, i3 will intercept any key presses that would otherwise be sent to sway. If you use the exact same key bindings then sway will never receive them.
i3-dmenu-desktop does not work.
There's a patch but it cannot be merged upstream. See issue #511 for more info.
My favorite application isn't displayed right, how can I fix this?
Disabling client-side Qt decorations
Qt currently defaults to using the X11 backend instead of its native Wayland backend. To use the Wayland backend, set QT_QPA_PLATFORM=wayland. Then Qt will also draw client-side decorations for all windows, to disable this, set QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
Window rules to adjust sway's borders
If you want to use a particular application's built-in window decorations over the sway borders, you can write a rule like this in your config:
for_window [app_id="nautilus"] border none
Issues with Java applications
code
Try to set _JAVA_AWT_WM_NONREPARENTING=1 in your environment (Source). You can achieve this by appending the following snippet to your ~/.profile file:
Try wmname as Suggested (Source) Package if above don't work. If there is error like cannot open display then use export DISPLAY=:0
wmname LG3D
This seems to fix blank windows and menus that are drawn at a wrong offset to the selected menu item.
Issues with JetBrains IDE popups/menus losing focus
Some JetBrains IDEs (including Android Studio) ship with a Java 1.8 JRE, but there are fixes included in later JRE versions that are necessary to run properly in Sway. You can instruct your IDE to use a different JRE through an invocation of the form:
If you are running Sway 1.4 or earlier, you will also need to upgrade to Sway/wlroots master, as there are necessary fixes there too.
Status icon doesn't show up
There are two standards for status icons: XEmbed and StatusNotifierItem (SNI). XEmbed is legacy and unimplemented in Sway. SNI is supported by swaybar. If your app uses XEmbed, the status icon won't show up. You should ask them to upgrade to SNI.
See here.
I have a multi-gpu setup (like intel+nvidia or intel+amd) and sway does not start / Some video cards cannot display / Full screen images, etc. will be corrupted
Unless specified otherwise, wlroots will choose a card for you and you could have a similar message in sway's log:
To use a different default card (listed in /dev/dri/), set this environment variable before starting sway:
WLR_DRM_DEVICES=/dev/dri/card1 sway
It's likely that you want sway to use the integrated (Intel) card, because probably that's the only one directly connected to the laptop monitor. However, the mapping between node names in /dev/dri/ and actual cards isn't guaranteed to be the same across reboots.
You can also configure multiple graphics cards like so:
The first card is used for actual rendering, and display buffers are copied to the secondary cards for any displays connected to them.
If your card paths aren't consistent (for example with eGPUs), you cannot use paths from /dev/dri/by-path, as they contain the delimiter which (unfortunately) cannot be escaped.
As a workaround you can create symlinks for the cards with a udev rule (/etc/udev/rules.d/set-dri-links.rules):
See GTK 3 settings on Wayland.
After unplugging an external display, some applications appear too large on my HiDPI screen
See wlroots issue #1119. This is an Xwayland bug fixed in 1.20.9.
Workaround:
code
If it does not exist, create the file ~/.Xresources
Add the following line to ~/.Xresources:
Xft.dpi: 96
Add the following line to the Sway config:
exec xrdb -load ~/.Xresources
Is an application using Xwayland?
To figure out whether an application uses Xwayland or native Wayland, you can try one of these solutions:
code
Run xeyes and move the mouse over the app. The eyes will only move if the window is using Xwayland.
Add for_window [shell=".*"] title_format "%title :: %shell" to your config file.
swaymsg -t get_tree dumps information about all windows.
Mouse events (clicking, scrolling) aren't working on some of my workspaces
This is a Xwayland bug. The workaround is to rearrange your workspaces to not use negative pixels.
Xwayland DPI increases after hotplug
This is an Xwayland bug. This usually results in oversized text. As a workaround, add Xft.dpi: 96 to ~/.Xresources and add exec xrdb -load ~/.Xresources to your Sway config.
I can't open links in external applications in Firefox
Adjust the paths so that they point to a valid location on your system.
GTK+ applications take 20 seconds to start
This is due to GTK+ waiting for xdg-desktop-portal to start via D-Bus. This times out because the D-Bus activated service doesn't know what WAYLAND_DISPLAY to connect to.
See Systemd and dbus activation environments
Alternatively, set GTK_USE_PORTAL=0 in your environment.
Generally speaking, running graphical applications as root is discouraged. Modern Linux distributions usually ship with a configured Polkit system which allows applications to request permissions for specific administrative actions as needed. Arch Linux wiki about Polkit is a good source of information https://wiki.archlinux.org/title/Polkit.
As a Sway user, all you probably need to do is run any one of the polkit auth agents. When a polkit auth agent is running you will get a prompt when an application supports Polkit and needs administrative permissions for some actions.
Auth agent exact location (and whether they are installed) depend on your distribution. Two most common agents are:
They usually reside in /usr/libexec or /usr/lib directories. You will want to put for example following in your sway config: exec "/usr/libexec/polkit-gnome-authentication-agent-1"
If the application does not support Polkit or you are running system without Polkit there is an additional fallback option if you really need to run a gui application as root: sudo --preserve-env=XDG_RUNTIME_DIR,WAYLAND_DISPLAY or simply sudo -E . This should be a last-resort option however.
Clutter applications hang at startup
This is ultimately caused by Clutter's reliance on the deprecated wl_shell protocol. Unless/until https://gitlab.gnome.org/GNOME/clutter/-/merge_requests/5 is merged, a workaround is to set CLUTTER_BACKEND=gdk to have it use gdk rather than attempt to interface directly with the compositor.
Sway 1.6 shows garbage or a blank screen on Nouveau
Could manifest as a blank screen where windows or bars are not drawn at all, only the mouse pointer. Could manifest an inactive display where the monitor receives no input at all.
Try setting WLR_DRM_NO_MODIFIERS=1. If you have it set, try un-setting it.
Issues when modifiers are enabled are due to two Nouveau bugs, fixed in these merge requests, and released in mesa 21.1.0:
If you use wireplumber, setting -l flag in wpctl can be used to prevent the volume from exceeding a certain level, which is not a feature offered by pactl. This example ensures that the volume does not surpass 120%:
Sometimes the kernel driver has trouble detecting hotplugged monitors on some ports. Try this (adapt card0 and DP-1 to the GPU and connector you're using):
echo detect | sudo tee /sys/class/drm/card0-DP-1/status
How do I utilize wp-fractional-scale-v1 since Sway 1.9?
Fractional scale protocol
code
This protocol allows a compositor to suggest for surfaces to render at fractional scales.
recent versions of Chrome/Chromium/Blink Derivatives utilize it automatically
recent Firefox versions require about:config widget.wayland.fractional-scale.enabled=true, which is as of 2024-03 having two bugs. Context Menu Broken, Blurred Windows when not maximized
mpv in standard configuration/wayland mode will utilize it automatically and appears to have no known issues
No hardware acceleration since Sway 1.10
Typically this results in error messages like these:
vulkan: No DRI3 support detected - required for presentation
Note: you can probably enable DRI3 in your Xorg config
or
DRI3 not available
or VA-API fails to initialize.
Sway 1.10 has removed support for the legacy wl_drm Wayland protocol, which is still used by Xwayland 23.2.4 and earlier, libva 2.20.0 and earlier, and AMDVLK.
As a workaround, the legacy wl_drm Wayland protocol can be re-enabled manually by passing -Dlegacy-wl-drm to Sway.
See:
code
xserver!1236
libva#788 and libva#790
AMDVLK#351
wmenu doesn't show command suggestions as you type
set $menu dmenu_path | wmenu | xargs swaymsg exec --
dmenu_path is provided by the package dmenu. Because it's often regarded as an optional dependency of Sway, it's likely that you don't have it installed.
UPDATE: Merged PR #8289 has eliminated the dependency on dmenu. The default configuration will run wmenu-run instead.
set $menu wmenu-run
but why copy, baby, why? why, is it alright, baby, why?:
"""
code
# 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
#
# Logo key. Use Mod1 for Alt.
set $mod Mod4
# Home row direction keys, like vim
set $left h
set $down j
set $up k
set $right l
# Your preferred terminal emulator
set $term foot
# Your preferred application launcher
set $menu wmenu-run
### Output configuration
#
# Default wallpaper (more resolutions are available in /usr/local/share/backgrounds/sway/)
output * bg /usr/local/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
#
# Example configuration:
#
# output HDMI-A-1 resolution 1920x1080 position 1920,0
#
# You can get the names of your outputs by running: swaymsg -t get_outputs
### Idle configuration
#
# Example configuration:
#
# exec swayidle -w \
# timeout 300 'swaylock -f -c 000000' \
# timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
# before-sleep 'swaylock -f -c 000000'
#
# This will lock your screen after 300 seconds of inactivity, then turn off
# your displays after another 300 seconds, and turn your screens back on when
# resumed. It will also lock your screen before your computer goes to sleep.
### Input configuration
#
# Example configuration:
#
# input "2:14:SynPS/2_Synaptics_TouchPad" {
# dwt enabled
# tap enabled
# natural_scroll enabled
# middle_emulation enabled
# }
#
# You can get the names of your inputs by running: swaymsg -t get_inputs
# Read `man 5 sway-input` for more information about this section.
### Key bindings
#
# Basics:
#
# Start a terminal
bindsym $mod+Return exec $term
# Kill focused window
bindsym $mod+Shift+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
# Exit sway (logs you out of your Wayland session)
bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'
#
# Moving around:
#
# Move your focus around
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
# Or use $mod+[up|down|left|right]
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
# Ditto, with arrow keys
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:
#
# Switch to workspace
bindsym $mod+1 workspace number 1
bindsym $mod+2 workspace number 2
bindsym $mod+3 workspace number 3
bindsym $mod+4 workspace number 4
bindsym $mod+5 workspace number 5
bindsym $mod+6 workspace number 6
bindsym $mod+7 workspace number 7
bindsym $mod+8 workspace number 8
bindsym $mod+9 workspace number 9
bindsym $mod+0 workspace number 10
# Move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number 1
bindsym $mod+Shift+2 move container to workspace number 2
bindsym $mod+Shift+3 move container to workspace number 3
bindsym $mod+Shift+4 move container to workspace number 4
bindsym $mod+Shift+5 move container to workspace number 5
bindsym $mod+Shift+6 move container to workspace number 6
bindsym $mod+Shift+7 move container to workspace number 7
bindsym $mod+Shift+8 move container to workspace number 8
bindsym $mod+Shift+9 move container to workspace number 9
bindsym $mod+Shift+0 move container to workspace number 10
# Note: workspaces can have any name you want, not just numbers.
# We just use 1-10 as the default.
#
# Layout stuff:
#
# You can "split" the current object of your focus with
# $mod+b or $mod+v, for horizontal and vertical splits
# respectively.
bindsym $mod+b 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 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+a focus parent
#
# Scratchpad:
#
# Sway has a "scratchpad", which is a bag of holding for windows.
# You can send windows there and get them back later.
# Move the currently focused window to the scratchpad
bindsym $mod+Shift+minus move scratchpad
# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
bindsym $mod+minus scratchpad show
#
# Resizing containers:
#
mode "resize" {
# left will shrink the containers width
# right will grow the containers width
# up will shrink the containers height
# down will grow the containers height
bindsym $left resize shrink width 10px
bindsym $down resize grow height 10px
bindsym $up resize shrink height 10px
bindsym $right resize grow width 10px
# Ditto, with arrow keys
bindsym Left resize shrink width 10px
bindsym Down resize grow height 10px
bindsym Up resize shrink height 10px
bindsym Right resize grow width 10px
# Return to default mode
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
#
# Utilities:
#
# Special keys to adjust volume via PulseAudio
bindsym --locked XF86AudioMute exec pactl set-sink-mute \@DEFAULT_SINK@ toggle
bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume \@DEFAULT_SINK@ -5%
bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume \@DEFAULT_SINK@ +5%
bindsym --locked XF86AudioMicMute exec pactl set-source-mute \@DEFAULT_SOURCE@ toggle
# Special keys to adjust brightness via brightnessctl
bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%-
bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+
# Special key to take a screenshot with grim
bindsym Print exec grim
#
# Status Bar:
#
# Read `man 5 sway-bar` for more information about this section.
bar {
position top
# When the status_command prints a new line to stdout, swaybar updates.
# The default just shows the current date and time.
status_command while date +'%Y-%m-%d %X'; do sleep 1; done
colors {
statusline #ffffff
background #323232
inactive_workspace #32323200 #32323200 #5c5c5c
}
}
include /usr/local/etc/sway/config.d/*
""".Login managers
Some login managers support Wayland, and others don't. If you have issues starting sway and you use a login manager, your first step should be disabling the login manager and running sway as described by man 1 sway. If it does not work, report the bug to your login manager, not to sway.
For a small list of compatible login managers, see the login manager list on the useful addons page.
You can start sway automatically without a login manager, for example, by adding this to your .bash_profile (.zlogin or .zprofile for Zsh):
If running from tty1 start sway
[ "$(tty)" = "/dev/tty1" ] && exec sway
For Fish, create the file ~/.config/fish/conf.d/sway.fish
The suggested location for the sway configuration file is ~/.config/sway/config. To begin configuring sway, create this directory and copy the default config.
Read the default config - it has comments that explain what each option does. Read man 5 sway for more information about each config command.
Display configuration
Sway manages displays for you, xrandr should not be used.
Run swaymsg -t get_outputs to get a list of output names. Then use the output command to arrange your displays.
For detailed information, check the manual. Run man 5 sway-output.
Multihead
Managing multiple monitors is simple through the use of multiple output commands.
e.g., if we want to have a monitor with HDMI1 and a resolution of 1920x1080, and to the right of it a laptop monitor with eDP1 and a resolution of 1600x900; the following two commands can be placed in your config file:
output HDMI1 pos 0 0 res 1920x1080
output eDP1 pos 1920 0 res 1600x900
Take a note that you might want to change the focus of monitor on sway launch. Add this to your sway config:
focus output
or
exec swaymsg focus output
so it doesn't trigger on reload.
For more details read man 5 sway-output.
Clamshell Mode
AKA Closed Display mode. This mode is where your laptop lid is closed and you have external monitor(s) as outputs. As of Sway 1.1 you can use switch events to drive certain functionality, such as disabling an output upon a laptop lid being closed. Pass your laptop output name into the following, which can be found with: swaymsg -t get_outputs for example eDP-1.
set laptop<laptoplaptop disable
bindswitch --reload --locked lid:off output $laptop enable
However, when reloading sway while using clamshell mode, the displays may reset (i.e. both displays will be enabled). To stop this, save this shell script:
case "LS"in∗open)swaymsgoutput"LAPTOP_OUTPUT" enable ;;
*closed) swaymsg output "$LAPTOP_OUTPUT" disable ;;
*) echo "Could not get lid state" >&2 ; exit 1 ;;
esac
Replace with the name of the display, ensure lid state file path is correct for your system.
To make sure this script runs whenever Sway is reloaded, add this line to your sway config:
exec_always /path/to/script.sh
HiDPI
HiDPI can be enabled via output and its scale option.
output scale
is the integer scaling factor (usually 2 for HiDPI screens)
If scaling is active, it has to be considered when defining relative positions. For example, if the scaling factor for the left monitor (HDMI1) is 2, the relative position for the right output has to be divided by 2. This example is illustrated by the configuration below:
output HDMI1 scale 2
output HDMI1 pos 0 0 res 3200x1800
output eDP1 pos 1600 0 res 1920x1080
Note that the x-pos of eDP1 is 1600 = 3200/2.
Fractional scaling
Fractional scaling is supported but is not recommended. Your display does not have fractional pixels - and if you enable fractional scaling we cannot display your windows faithfully and your image quality will be degraded, for clients that do not report HiDPI surfaces (including all XWayland clients, but usually does not include modern versions of Wayland-native GUI toolkits). If you use many such programs, you should instead choose the integer scale factor appropriate for your display and configure your software's font size as necessary. If you still want to use fractional scaling, it is as simple as e.g. output scale 1.5.
Display rotation
output transform 90 will rotate output by 90 degrees clockwise. Read man 5 sway-output and search for transform to see other options, like flipping across an axis.
For automatic display rotation via a built-in accelerometer, see rot8.
Redshift equivalent
Redshift adjusts the color temperature of your screen according to your surroundings. This may help your eyes hurt less if you are working in front of the screen at night. Unfortunately, Redshift does not support Wayland.
However, there is a fork of Redshift called gammastep which does have Wayland support. On Arch Linux, it is available as an official package.
Other alternatives are wlsunset, wl-gammarelay and wl-gammarelay-rs.
Input configuration
A list of input devices is available by running swaymsg -t get_inputs. Use the identifier for the device you want to configure in your config file:
input {
# ...config options...
}
Nothing prevents having multiple configurations for different specific devices:
default layout
input "1:1:AT_Translated_Set_2_keyboard" {
xkb_layout us
}
See man 7 xkeyboard-config for options you can use with the xkb_layout, xkb_model, xkb_options, xkb_rules, and xkb_variant commands. Separate multiple options with commas.
User-specific settings such as symbols will be loaded from their respective directories in ~/.xkb/ or $XDG_CONFIG_HOME/xkb/.
A lot of modifications are available through xkb_options. They can be found in /usr/share/X11/xkb/symbols/{altwin,capslock,compose,ctrl} and the respective option name in /usr/share/X11/xkb/rules/base.
Examples:
code
Make caps lock work as escape: xkb_options caps:escape
Swap escape and caps lock: xkb_options caps:swapescape
Make caps lock work as control: xkb_options ctrl:nocaps
Make caps lock work as additional control xkb_options caps:ctrl_modifier
Swap left alt and super, and set caps lock to escape: xkb_options altwin:swap_lalt_lwin,caps:escape
Make the menu key work as additional super: xkb_options altwin:menu_win
Note that to trigger several options, you need to list them separated with a comma, e.g. xkb_options caps:escape,altwin:swap_lalt_lwin; if you instead write several xkb_options-lines, only the last one will take effect.
Load custom xkb keymap file (since #3999)
The full documentation on how to override keymappings is available at this link. Here a slightly digested version with a practical commented example.
Libinput config options
input {
left_handed enabled
tap enabled
natural_scroll disabled
dwt enabled
accel_profile "flat" # disable mouse acceleration (enabled by default; to set it manually, use "adaptive" instead of "flat")
pointer_accel 0.5 # set mouse sensitivity (between -1 and 1)
}
See man 5 sway-input for all available options.
Touch Display Mapping
Touch input targets for touch displays used in a multi-display environment must be mapped to that touch display only.
set display1"DellInc.DELLP2414HVHVTW542165L"setdisplay2 "Dell Inc. DELL P2418HT MYDM775F152L"
set $display2-touch "8146:24835:Melfas_LGD_AIT_Touch_Controller"
input display2−touchmaptooudisplay2
Wallpapers
Feh and similar tools do not work on Wayland. Sway supports setting wallpapers if swaybg is installed. You can use this feature through the output command, using the bg option:
e.g. output HDMI-A-1 bg ~/wallpaper.png stretch
See output configuration options in man 5 sway-output.
Swaybar supports most of the same features as i3bar, and is configured in the same way. Add a bar section to your config:
bar {
# ...bar options..
}
For the full list of options, see man 5 sway-bar.
Comments
Comments are supported in the configuration and start with a # character, optionally with whitespace before it. Comments and commands on the same line are not supported, because i3 - and thus Sway - supports the #RRGGBB syntax for specifying colours. Therefore, always place comments on their own line.
Additionally, a commented out line with a trailing backslash currently affects the next line, even if that is not a comment. So, never end a commented line with a backslash .
Taking screenshots
X11 tools like scrot do not work. Try grim.
Grimshot provides a simpler command line interface if you're looking for something more high level (and relies on grim and slurp internally).
shotman is a simple, light, modern UI for screenshooting, also relies on slurp for region selection, and taking screenshot of current active window only works in sway for now.
flameshot has a simple and inituitive GUI with various editing tools.
swappy is another tool (written in C, uses GTK and Pango) that pops up a GUI and allows basic operations on the screenshot such as adding text, arrows, circles, squares and choosing colors. Has a config file to customize the GUI. Can also work without grim.
Try wf-recorder for screen recording of wlroots-based compositors like swaywm. If you use OBS Studio, versions newer than 27.0 natively support screen recording using pipewire. For older versions you can use wlrobs recording plugin for wlroots-based compositors.
bemenu works as a dmenu replacement.
sway-launcher-desktop: TUI Application launcher with Desktop Entry support.
wofi is a rofi-like launcher.
yofi is a minimalistic menu for wayland.
tofi is an extremely performant wlroots-specific launcher.
Not yet possible with swaywm/wlroots. Please look / get involved here.
Setting environmental variables
How you set variables will depend on how sway was started.
Environment variables are inherited from the process that starts sway. You need to set variables there.
Some of the possible options are:
code
login manager: check the documentation.
login shell: export them there before launching sway.
user service: use the EnvironmentFile= key and an environment file.
More details here.
FAQ
Before asking questions...
Update both sway and wlroots and then try again. Look through known issues in sway and known issues in wlroots. Did you read the man pages? Start with man sway. Read your config file, too. And read the log.
How do I get rid of title bars on applications?
Use the default_border command in your config. default_border normal shows title bars, whereas none and pixel do not. The border command operates on the currently focused window only. default_border is a setting, border is an action.
Note that default_border only affects new windows. Even after reloading sway, you will need to close and re-open any windows you do not wish to see the title bar on.
Where are my tray icons?
Initial tray icon support for swaybar was merged with #3249 pull request. Missing features are tracked in #3799.
How do I configure urxvt transparency?
urxvt transparency requires "real transparency" settings. Add this to your .Xresources and reload via xrdb ~/.Xresources:
Be aware that this configuration will conflict with the URxvt.reversevideo and if you enable the reversevideo option, the text will become transparent instead of the background.
You may wish to add exec xrdb ~/.Xresources to your sway config to configure this on startup.
I'm not using logind but still want DBus/PolKit/power management to work.
Alternatively, you could omit the ck-launch-session part.
xbacklight
xbacklight is, as the name would imply, a tool for X. Instead, you can use brightnessctl, brillo or just directly manipulate /sys/class/backlight.
For instance:
bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%-
bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+
Which terminal emulator can I use?
You can use either X- or Wayland-native terminal emulator with little difference in terms of functionality.
Alacritty, Kitty, foot, GhosTTY, or wezterm will use Wayland without additional configuration. You can use VTE-based terminals like GNOME Terminal. X-based urxvt is another popular option.
Why am I getting Error on line XX […] Unknown key?
In your config, you should replace at line XX bindsym by bindcode.
Locale-specific configuration tricks
Workspace switching on the French layout
Because French number keys only produce numbers when Shift is pressed (or Caps Lock is active), you'll need to setup key bindings with the various special characters under the numbers (&, é, ", etc):
code
# Switch to workspace
bindsym $mod+ampersand workspace number 1
bindsym $mod+eacute workspace number 2
bindsym $mod+quotedbl workspace number 3
bindsym $mod+apostrophe workspace number 4
bindsym $mod+parenleft workspace number 5
bindsym $mod+minus workspace number 6
bindsym $mod+egrave workspace number 7
bindsym $mod+underscore workspace number 8
bindsym $mod+ccedilla workspace number 9
bindsym $mod+agrave workspace number 10
# Move focused container to workspace
bindsym $mod+Shift+ampersand move container to workspace number 1
bindsym $mod+Shift+eacute move container to workspace number 2
bindsym $mod+Shift+quotedbl move container to workspace number 3
bindsym $mod+Shift+apostrophe move container to workspace number 4
bindsym $mod+Shift+parenleft move container to workspace number 5
bindsym $mod+Shift+minus move container to workspace number 6
bindsym $mod+Shift+egrave move container to workspace number 7
bindsym $mod+Shift+underscore move container to workspace number 8
bindsym $mod+Shift+ccedilla move container to workspace number 9
bindsym $mod+Shift+agrave move container to workspace number 10
Key bindings on a dual US/Russian layout or US/Greek
If you have configured your keyboard with a US and a Russian layout (input * xkb_layout us,ru), your bindings using Latin script letters won't work when the Russian keyboard is active (for instance, $mod+f won't work, because you can't produce the letter f with the Russian layout).
To make key bindings work regardless of the currently active layout, you can use bindsym --to-code:
bindsym --to-code {
mod+bsplithmod+v splitv
}
Windows/KDE/gnome launcher shortcut
This will toggle the launcher on a single keypress, but not if a keybind was triggered with that key.
If you want your workspace to be moved to the current output when you switch to it using mod+mod+ lines in your configuration with this (for each of course):
bindsym mod+1[workspace="1"] move workspace to output current; workspace number 1
Move all workspace windows
set modemovemode_move_all_workspace_windows {
bindsym 1 [workspace="."] move to workspace 2; workspace number 2, mode "default"
bindsym 3 [workspace="."] move to workspace 4; workspace number 4, mode "default"
bindsym 5 [workspace="."] move to workspace 6; workspace number 6, mode "default"
bindsym 7 [workspace="."] move to workspace 8; workspace number 8, mode "default"
bindsym 9 [workspace="."] move to workspace 10; workspace number 10, mode "default"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym mode_move_all_workspace_windows
XDG_CURRENT_DESKTOP environment variable is not being set
Some applications and desktop mechanisms may rely on the XDG_CURRENT_DESKTOP environment variable to be set so that the application can accommodate for being ran under sway. Examples include XDG autostart implementations, screensharing in Firefox and many others.
Sway itself does not set this variable, it should be set before sway is started. Sane default would be sway:wlroots (specific sway as first priority, common wlroots after it to be in line with other wlroots compositors). If you start sway from shell profile, export it before sway invocation. If you use a login manager, the login manager will use the DesktopNames attribute inside the sway.desktop file. This file may be modified to add DesktopNames=sway;wlroots (also see #7952).
It's not good practice for applications to make use of XDG_CURRENT_DESKTOP in this way, and Firefox has an issue open to try to fix it. Refer to xpdw's FAQ and xdpw's Troubleshooting guide if your issue is specifically related to screensharing.
Systemd and dbus activation environments
Some variables need to be exported to systemd and/or dbus activation environments so tools that rely on them work properly. The essential ones are: WAYLAND_DISPLAY, DISPLAY (if XWayland is used), XDG_CURRENT_DESKTOP, plus Sway's: SWAYSOCK, I3SOCK, XCURSOR_SIZE, XCURSOR_THEME.
Export should be performed from context of running sway process, via exec statements in sway's configuration:
We will expect three things from you: your sway version, your config file, and a debug log. Obtain your version like so:
swaymsg -t get_version
If this doesn't work, use:
sway -v
Obtain a debug log like so:
sway -d 2> ~/sway.log
This will record information about sway's activity when it's running. Briefly reproduce your problem and exit sway. Upload this file, along with your config, to gist.github.com, and include this in a GitHub issue (or when asking for help on IRC). When preparing a debug log, make it brief - start up sway, do the minimum work necessary to reproduce the error, then close sway. Explain the steps you took in plain English in your GitHub issue as well.
If the problem isn't immediately obvious, you will likely be required to debug it yourself - we are volunteers and only have so much free time.
I just installed sway. I can move my mouse cursor but my keyboard does not work.
Are you pressing keys that are bound to do anything? Read the config file. If mod+Returnisbounmod+2 or $mod+8 - does it switch workspaces?
I can't run anything.
Check for keyboard shortcuts in the config file to start your launcher. Are you trying to run x applications? You probably don't have xwayland installed. Consult your distribution's documentation for instructions on installing xwayland.
My keyboard shortcuts do not work.
If you're running sway on top of X11, with i3 running, i3 will intercept any key presses that would otherwise be sent to sway. If you use the exact same key bindings then sway will never receive them.
i3-dmenu-desktop does not work.
There's a patch but it cannot be merged upstream. See issue #511 for more info.
My favorite application isn't displayed right, how can I fix this?
Disabling client-side Qt decorations
Qt currently defaults to using the X11 backend instead of its native Wayland backend. To use the Wayland backend, set QT_QPA_PLATFORM=wayland. Then Qt will also draw client-side decorations for all windows, to disable this, set QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
Window rules to adjust sway's borders
If you want to use a particular application's built-in window decorations over the sway borders, you can write a rule like this in your config:
for_window [app_id="nautilus"] border none
Issues with Java applications
code
Try to set _JAVA_AWT_WM_NONREPARENTING=1 in your environment (Source). You can achieve this by appending the following snippet to your ~/.profile file:
Try wmname as Suggested (Source) Package if above don't work. If there is error like cannot open display then use export DISPLAY=:0
wmname LG3D
This seems to fix blank windows and menus that are drawn at a wrong offset to the selected menu item.
Issues with JetBrains IDE popups/menus losing focus
Some JetBrains IDEs (including Android Studio) ship with a Java 1.8 JRE, but there are fixes included in later JRE versions that are necessary to run properly in Sway. You can instruct your IDE to use a different JRE through an invocation of the form:
If you are running Sway 1.4 or earlier, you will also need to upgrade to Sway/wlroots master, as there are necessary fixes there too.
Status icon doesn't show up
There are two standards for status icons: XEmbed and StatusNotifierItem (SNI). XEmbed is legacy and unimplemented in Sway. SNI is supported by swaybar. If your app uses XEmbed, the status icon won't show up. You should ask them to upgrade to SNI.
See here.
I have a multi-gpu setup (like intel+nvidia or intel+amd) and sway does not start / Some video cards cannot display / Full screen images, etc. will be corrupted
Unless specified otherwise, wlroots will choose a card for you and you could have a similar message in sway's log:
To use a different default card (listed in /dev/dri/), set this environment variable before starting sway:
WLR_DRM_DEVICES=/dev/dri/card1 sway
It's likely that you want sway to use the integrated (Intel) card, because probably that's the only one directly connected to the laptop monitor. However, the mapping between node names in /dev/dri/ and actual cards isn't guaranteed to be the same across reboots.
You can also configure multiple graphics cards like so:
The first card is used for actual rendering, and display buffers are copied to the secondary cards for any displays connected to them.
If your card paths aren't consistent (for example with eGPUs), you cannot use paths from /dev/dri/by-path, as they contain the delimiter which (unfortunately) cannot be escaped.
As a workaround you can create symlinks for the cards with a udev rule (/etc/udev/rules.d/set-dri-links.rules):
See GTK 3 settings on Wayland.
After unplugging an external display, some applications appear too large on my HiDPI screen
See wlroots issue #1119. This is an Xwayland bug fixed in 1.20.9.
Workaround:
code
If it does not exist, create the file ~/.Xresources
Add the following line to ~/.Xresources:
Xft.dpi: 96
Add the following line to the Sway config:
exec xrdb -load ~/.Xresources
Is an application using Xwayland?
To figure out whether an application uses Xwayland or native Wayland, you can try one of these solutions:
code
Run xeyes and move the mouse over the app. The eyes will only move if the window is using Xwayland.
Add for_window [shell=".*"] title_format "%title :: %shell" to your config file.
swaymsg -t get_tree dumps information about all windows.
Mouse events (clicking, scrolling) aren't working on some of my workspaces
This is a Xwayland bug. The workaround is to rearrange your workspaces to not use negative pixels.
Xwayland DPI increases after hotplug
This is an Xwayland bug. This usually results in oversized text. As a workaround, add Xft.dpi: 96 to ~/.Xresources and add exec xrdb -load ~/.Xresources to your Sway config.
I can't open links in external applications in Firefox
Adjust the paths so that they point to a valid location on your system.
GTK+ applications take 20 seconds to start
This is due to GTK+ waiting for xdg-desktop-portal to start via D-Bus. This times out because the D-Bus activated service doesn't know what WAYLAND_DISPLAY to connect to.
See Systemd and dbus activation environments
Alternatively, set GTK_USE_PORTAL=0 in your environment.
Generally speaking, running graphical applications as root is discouraged. Modern Linux distributions usually ship with a configured Polkit system which allows applications to request permissions for specific administrative actions as needed. Arch Linux wiki about Polkit is a good source of information https://wiki.archlinux.org/title/Polkit.
As a Sway user, all you probably need to do is run any one of the polkit auth agents. When a polkit auth agent is running you will get a prompt when an application supports Polkit and needs administrative permissions for some actions.
Auth agent exact location (and whether they are installed) depend on your distribution. Two most common agents are:
They usually reside in /usr/libexec or /usr/lib directories. You will want to put for example following in your sway config: exec "/usr/libexec/polkit-gnome-authentication-agent-1"
If the application does not support Polkit or you are running system without Polkit there is an additional fallback option if you really need to run a gui application as root: sudo --preserve-env=XDG_RUNTIME_DIR,WAYLAND_DISPLAY or simply sudo -E . This should be a last-resort option however.
Clutter applications hang at startup
This is ultimately caused by Clutter's reliance on the deprecated wl_shell protocol. Unless/until https://gitlab.gnome.org/GNOME/clutter/-/merge_requests/5 is merged, a workaround is to set CLUTTER_BACKEND=gdk to have it use gdk rather than attempt to interface directly with the compositor.
Sway 1.6 shows garbage or a blank screen on Nouveau
Could manifest as a blank screen where windows or bars are not drawn at all, only the mouse pointer. Could manifest an inactive display where the monitor receives no input at all.
Try setting WLR_DRM_NO_MODIFIERS=1. If you have it set, try un-setting it.
Issues when modifiers are enabled are due to two Nouveau bugs, fixed in these merge requests, and released in mesa 21.1.0:
If you use wireplumber, setting -l flag in wpctl can be used to prevent the volume from exceeding a certain level, which is not a feature offered by pactl. This example ensures that the volume does not surpass 120%:
Sometimes the kernel driver has trouble detecting hotplugged monitors on some ports. Try this (adapt card0 and DP-1 to the GPU and connector you're using):
echo detect | sudo tee /sys/class/drm/card0-DP-1/status
How do I utilize wp-fractional-scale-v1 since Sway 1.9?
Fractional scale protocol
code
This protocol allows a compositor to suggest for surfaces to render at fractional scales.
recent versions of Chrome/Chromium/Blink Derivatives utilize it automatically
recent Firefox versions require about:config widget.wayland.fractional-scale.enabled=true, which is as of 2024-03 having two bugs. Context Menu Broken, Blurred Windows when not maximized
mpv in standard configuration/wayland mode will utilize it automatically and appears to have no known issues
No hardware acceleration since Sway 1.10
Typically this results in error messages like these:
vulkan: No DRI3 support detected - required for presentation
Note: you can probably enable DRI3 in your Xorg config
or
DRI3 not available
or VA-API fails to initialize.
Sway 1.10 has removed support for the legacy wl_drm Wayland protocol, which is still used by Xwayland 23.2.4 and earlier, libva 2.20.0 and earlier, and AMDVLK.
As a workaround, the legacy wl_drm Wayland protocol can be re-enabled manually by passing -Dlegacy-wl-drm to Sway.
See:
code
xserver!1236
libva#788 and libva#790
AMDVLK#351
wmenu doesn't show command suggestions as you type
set $menu dmenu_path | wmenu | xargs swaymsg exec --
dmenu_path is provided by the package dmenu. Because it's often regarded as an optional dependency of Sway, it's likely that you don't have it installed.
UPDATE: Merged PR #8289 has eliminated the dependency on dmenu. The default configuration will run wmenu-run instead.
set $menu wmenu-run
Ease of Setup: Many users copy configuration files to get started with Sway quickly without having to write everything from scratch.
Customization: The configurations often serve as templates that users modify according to their preferences. This allows individuals to set up their environments more efficiently.
Documentation: Such documents serve as a reference for users. They can look up options, commands, and examples without needing to search extensively online.
Sharing Knowledge: The community often shares configurations to help others, creating a culture of collaboration and learning.
Best Practices: By copying proven configurations, users can ensure they are applying best practices established by the community.
Is It Alright, Baby, Why?
If you're asking whether it's appropriate to copy and use configurations, yes, that's entirely acceptable in open-source software communities. It's part of the collaborative spirit, as long as you respect licenses and follow any attribution guidelines specified by the original authors. Customizing configurations to meet your own needs is encouraged, and learning from shared resources can accelerate your understanding and mastery of the tools you are using.
If you want to dive deeper into specific sections, need help customizing your Sway setup, or have queries about the documentation, feel free to ask!
but why copy, baby, why? why, is it alright, baby, why?:
"""
code
# 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
#
# Logo key. Use Mod1 for Alt.
set $mod Mod4
# Home row direction keys, like vim
set $left h
set $down j
set $up k
set $right l
# Your preferred terminal emulator
set $term foot
# Your preferred application launcher
set $menu wmenu-run
### Output configuration
#
# Default wallpaper (more resolutions are available in /usr/local/share/backgrounds/sway/)
output * bg /usr/local/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
#
# Example configuration:
#
# output HDMI-A-1 resolution 1920x1080 position 1920,0
#
# You can get the names of your outputs by running: swaymsg -t get_outputs
### Idle configuration
#
# Example configuration:
#
# exec swayidle -w \
# timeout 300 'swaylock -f -c 000000' \
# timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
# before-sleep 'swaylock -f -c 000000'
#
# This will lock your screen after 300 seconds of inactivity, then turn off
# your displays after another 300 seconds, and turn your screens back on when
# resumed. It will also lock your screen before your computer goes to sleep.
### Input configuration
#
# Example configuration:
#
# input "2:14:SynPS/2_Synaptics_TouchPad" {
# dwt enabled
# tap enabled
# natural_scroll enabled
# middle_emulation enabled
# }
#
# You can get the names of your inputs by running: swaymsg -t get_inputs
# Read `man 5 sway-input` for more information about this section.
### Key bindings
#
# Basics:
#
# Start a terminal
bindsym $mod+Return exec $term
# Kill focused window
bindsym $mod+Shift+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
# Exit sway (logs you out of your Wayland session)
bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'
#
# Moving around:
#
# Move your focus around
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
# Or use $mod+[up|down|left|right]
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
# Ditto, with arrow keys
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:
#
# Switch to workspace
bindsym $mod+1 workspace number 1
bindsym $mod+2 workspace number 2
bindsym $mod+3 workspace number 3
bindsym $mod+4 workspace number 4
bindsym $mod+5 workspace number 5
bindsym $mod+6 workspace number 6
bindsym $mod+7 workspace number 7
bindsym $mod+8 workspace number 8
bindsym $mod+9 workspace number 9
bindsym $mod+0 workspace number 10
# Move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number 1
bindsym $mod+Shift+2 move container to workspace number 2
bindsym $mod+Shift+3 move container to workspace number 3
bindsym $mod+Shift+4 move container to workspace number 4
bindsym $mod+Shift+5 move container to workspace number 5
bindsym $mod+Shift+6 move container to workspace number 6
bindsym $mod+Shift+7 move container to workspace number 7
bindsym $mod+Shift+8 move container to workspace number 8
bindsym $mod+Shift+9 move container to workspace number 9
bindsym $mod+Shift+0 move container to workspace number 10
# Note: workspaces can have any name you want, not just numbers.
# We just use 1-10 as the default.
#
# Layout stuff:
#
# You can "split" the current object of your focus with
# $mod+b or $mod+v, for horizontal and vertical splits
# respectively.
bindsym $mod+b 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 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+a focus parent
#
# Scratchpad:
#
# Sway has a "scratchpad", which is a bag of holding for windows.
# You can send windows there and get them back later.
# Move the currently focused window to the scratchpad
bindsym $mod+Shift+minus move scratchpad
# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
bindsym $mod+minus scratchpad show
#
# Resizing containers:
#
mode "resize" {
# left will shrink the containers width
# right will grow the containers width
# up will shrink the containers height
# down will grow the containers height
bindsym $left resize shrink width 10px
bindsym $down resize grow height 10px
bindsym $up resize shrink height 10px
bindsym $right resize grow width 10px
# Ditto, with arrow keys
bindsym Left resize shrink width 10px
bindsym Down resize grow height 10px
bindsym Up resize shrink height 10px
bindsym Right resize grow width 10px
# Return to default mode
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
#
# Utilities:
#
# Special keys to adjust volume via PulseAudio
bindsym --locked XF86AudioMute exec pactl set-sink-mute \@DEFAULT_SINK@ toggle
bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume \@DEFAULT_SINK@ -5%
bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume \@DEFAULT_SINK@ +5%
bindsym --locked XF86AudioMicMute exec pactl set-source-mute \@DEFAULT_SOURCE@ toggle
# Special keys to adjust brightness via brightnessctl
bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%-
bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+
# Special key to take a screenshot with grim
bindsym Print exec grim
#
# Status Bar:
#
# Read `man 5 sway-bar` for more information about this section.
bar {
position top
# When the status_command prints a new line to stdout, swaybar updates.
# The default just shows the current date and time.
status_command while date +'%Y-%m-%d %X'; do sleep 1; done
colors {
statusline #ffffff
background #323232
inactive_workspace #32323200 #32323200 #5c5c5c
}
}
include /usr/local/etc/sway/config.d/*
""".Login managers
Some login managers support Wayland, and others don't. If you have issues starting sway and you use a login manager, your first step should be disabling the login manager and running sway as described by man 1 sway. If it does not work, report the bug to your login manager, not to sway.
For a small list of compatible login managers, see the login manager list on the useful addons page.
You can start sway automatically without a login manager, for example, by adding this to your .bash_profile (.zlogin or .zprofile for Zsh):
If running from tty1 start sway
[ "$(tty)" = "/dev/tty1" ] && exec sway
For Fish, create the file ~/.config/fish/conf.d/sway.fish
The suggested location for the sway configuration file is ~/.config/sway/config. To begin configuring sway, create this directory and copy the default config.
Read the default config - it has comments that explain what each option does. Read man 5 sway for more information about each config command.
Display configuration
Sway manages displays for you, xrandr should not be used.
Run swaymsg -t get_outputs to get a list of output names. Then use the output command to arrange your displays.
For detailed information, check the manual. Run man 5 sway-output.
Multihead
Managing multiple monitors is simple through the use of multiple output commands.
e.g., if we want to have a monitor with HDMI1 and a resolution of 1920x1080, and to the right of it a laptop monitor with eDP1 and a resolution of 1600x900; the following two commands can be placed in your config file:
output HDMI1 pos 0 0 res 1920x1080
output eDP1 pos 1920 0 res 1600x900
Take a note that you might want to change the focus of monitor on sway launch. Add this to your sway config:
focus output
or
exec swaymsg focus output
so it doesn't trigger on reload.
For more details read man 5 sway-output.
Clamshell Mode
AKA Closed Display mode. This mode is where your laptop lid is closed and you have external monitor(s) as outputs. As of Sway 1.1 you can use switch events to drive certain functionality, such as disabling an output upon a laptop lid being closed. Pass your laptop output name into the following, which can be found with: swaymsg -t get_outputs for example eDP-1.
set laptop<laptoplaptop disable
bindswitch --reload --locked lid:off output $laptop enable
However, when reloading sway while using clamshell mode, the displays may reset (i.e. both displays will be enabled). To stop this, save this shell script:
case "LS"in∗open)swaymsgoutput"LAPTOP_OUTPUT" enable ;;
*closed) swaymsg output "$LAPTOP_OUTPUT" disable ;;
*) echo "Could not get lid state" >&2 ; exit 1 ;;
esac
Replace with the name of the display, ensure lid state file path is correct for your system.
To make sure this script runs whenever Sway is reloaded, add this line to your sway config:
exec_always /path/to/script.sh
HiDPI
HiDPI can be enabled via output and its scale option.
output scale
is the integer scaling factor (usually 2 for HiDPI screens)
If scaling is active, it has to be considered when defining relative positions. For example, if the scaling factor for the left monitor (HDMI1) is 2, the relative position for the right output has to be divided by 2. This example is illustrated by the configuration below:
output HDMI1 scale 2
output HDMI1 pos 0 0 res 3200x1800
output eDP1 pos 1600 0 res 1920x1080
Note that the x-pos of eDP1 is 1600 = 3200/2.
Fractional scaling
Fractional scaling is supported but is not recommended. Your display does not have fractional pixels - and if you enable fractional scaling we cannot display your windows faithfully and your image quality will be degraded, for clients that do not report HiDPI surfaces (including all XWayland clients, but usually does not include modern versions of Wayland-native GUI toolkits). If you use many such programs, you should instead choose the integer scale factor appropriate for your display and configure your software's font size as necessary. If you still want to use fractional scaling, it is as simple as e.g. output scale 1.5.
Display rotation
output transform 90 will rotate output by 90 degrees clockwise. Read man 5 sway-output and search for transform to see other options, like flipping across an axis.
For automatic display rotation via a built-in accelerometer, see rot8.
Redshift equivalent
Redshift adjusts the color temperature of your screen according to your surroundings. This may help your eyes hurt less if you are working in front of the screen at night. Unfortunately, Redshift does not support Wayland.
However, there is a fork of Redshift called gammastep which does have Wayland support. On Arch Linux, it is available as an official package.
Other alternatives are wlsunset, wl-gammarelay and wl-gammarelay-rs.
Input configuration
A list of input devices is available by running swaymsg -t get_inputs. Use the identifier for the device you want to configure in your config file:
input {
# ...config options...
}
Nothing prevents having multiple configurations for different specific devices:
default layout
input "1:1:AT_Translated_Set_2_keyboard" {
xkb_layout us
}
See man 7 xkeyboard-config for options you can use with the xkb_layout, xkb_model, xkb_options, xkb_rules, and xkb_variant commands. Separate multiple options with commas.
User-specific settings such as symbols will be loaded from their respective directories in ~/.xkb/ or $XDG_CONFIG_HOME/xkb/.
A lot of modifications are available through xkb_options. They can be found in /usr/share/X11/xkb/symbols/{altwin,capslock,compose,ctrl} and the respective option name in /usr/share/X11/xkb/rules/base.
Examples:
code
Make caps lock work as escape: xkb_options caps:escape
Swap escape and caps lock: xkb_options caps:swapescape
Make caps lock work as control: xkb_options ctrl:nocaps
Make caps lock work as additional control xkb_options caps:ctrl_modifier
Swap left alt and super, and set caps lock to escape: xkb_options altwin:swap_lalt_lwin,caps:escape
Make the menu key work as additional super: xkb_options altwin:menu_win
Note that to trigger several options, you need to list them separated with a comma, e.g. xkb_options caps:escape,altwin:swap_lalt_lwin; if you instead write several xkb_options-lines, only the last one will take effect.
Load custom xkb keymap file (since #3999)
The full documentation on how to override keymappings is available at this link. Here a slightly digested version with a practical commented example.
Libinput config options
input {
left_handed enabled
tap enabled
natural_scroll disabled
dwt enabled
accel_profile "flat" # disable mouse acceleration (enabled by default; to set it manually, use "adaptive" instead of "flat")
pointer_accel 0.5 # set mouse sensitivity (between -1 and 1)
}
See man 5 sway-input for all available options.
Touch Display Mapping
Touch input targets for touch displays used in a multi-display environment must be mapped to that touch display only.
set display1"DellInc.DELLP2414HVHVTW542165L"setdisplay2 "Dell Inc. DELL P2418HT MYDM775F152L"
set $display2-touch "8146:24835:Melfas_LGD_AIT_Touch_Controller"
input display2−touchmaptooudisplay2
Wallpapers
Feh and similar tools do not work on Wayland. Sway supports setting wallpapers if swaybg is installed. You can use this feature through the output command, using the bg option:
e.g. output HDMI-A-1 bg ~/wallpaper.png stretch
See output configuration options in man 5 sway-output.
Swaybar supports most of the same features as i3bar, and is configured in the same way. Add a bar section to your config:
bar {
# ...bar options..
}
For the full list of options, see man 5 sway-bar.
Comments
Comments are supported in the configuration and start with a # character, optionally with whitespace before it. Comments and commands on the same line are not supported, because i3 - and thus Sway - supports the #RRGGBB syntax for specifying colours. Therefore, always place comments on their own line.
Additionally, a commented out line with a trailing backslash currently affects the next line, even if that is not a comment. So, never end a commented line with a backslash .
Taking screenshots
X11 tools like scrot do not work. Try grim.
Grimshot provides a simpler command line interface if you're looking for something more high level (and relies on grim and slurp internally).
shotman is a simple, light, modern UI for screenshooting, also relies on slurp for region selection, and taking screenshot of current active window only works in sway for now.
flameshot has a simple and inituitive GUI with various editing tools.
swappy is another tool (written in C, uses GTK and Pango) that pops up a GUI and allows basic operations on the screenshot such as adding text, arrows, circles, squares and choosing colors. Has a config file to customize the GUI. Can also work without grim.
Try wf-recorder for screen recording of wlroots-based compositors like swaywm. If you use OBS Studio, versions newer than 27.0 natively support screen recording using pipewire. For older versions you can use wlrobs recording plugin for wlroots-based compositors.
bemenu works as a dmenu replacement.
sway-launcher-desktop: TUI Application launcher with Desktop Entry support.
wofi is a rofi-like launcher.
yofi is a minimalistic menu for wayland.
tofi is an extremely performant wlroots-specific launcher.
Not yet possible with swaywm/wlroots. Please look / get involved here.
Setting environmental variables
How you set variables will depend on how sway was started.
Environment variables are inherited from the process that starts sway. You need to set variables there.
Some of the possible options are:
code
login manager: check the documentation.
login shell: export them there before launching sway.
user service: use the EnvironmentFile= key and an environment file.
More details here.
FAQ
Before asking questions...
Update both sway and wlroots and then try again. Look through known issues in sway and known issues in wlroots. Did you read the man pages? Start with man sway. Read your config file, too. And read the log.
How do I get rid of title bars on applications?
Use the default_border command in your config. default_border normal shows title bars, whereas none and pixel do not. The border command operates on the currently focused window only. default_border is a setting, border is an action.
Note that default_border only affects new windows. Even after reloading sway, you will need to close and re-open any windows you do not wish to see the title bar on.
Where are my tray icons?
Initial tray icon support for swaybar was merged with #3249 pull request. Missing features are tracked in #3799.
How do I configure urxvt transparency?
urxvt transparency requires "real transparency" settings. Add this to your .Xresources and reload via xrdb ~/.Xresources:
Be aware that this configuration will conflict with the URxvt.reversevideo and if you enable the reversevideo option, the text will become transparent instead of the background.
You may wish to add exec xrdb ~/.Xresources to your sway config to configure this on startup.
I'm not using logind but still want DBus/PolKit/power management to work.
Alternatively, you could omit the ck-launch-session part.
xbacklight
xbacklight is, as the name would imply, a tool for X. Instead, you can use brightnessctl, brillo or just directly manipulate /sys/class/backlight.
For instance:
bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%-
bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+
Which terminal emulator can I use?
You can use either X- or Wayland-native terminal emulator with little difference in terms of functionality.
Alacritty, Kitty, foot, GhosTTY, or wezterm will use Wayland without additional configuration. You can use VTE-based terminals like GNOME Terminal. X-based urxvt is another popular option.
Why am I getting Error on line XX […] Unknown key?
In your config, you should replace at line XX bindsym by bindcode.
Locale-specific configuration tricks
Workspace switching on the French layout
Because French number keys only produce numbers when Shift is pressed (or Caps Lock is active), you'll need to setup key bindings with the various special characters under the numbers (&, é, ", etc):
code
# Switch to workspace
bindsym $mod+ampersand workspace number 1
bindsym $mod+eacute workspace number 2
bindsym $mod+quotedbl workspace number 3
bindsym $mod+apostrophe workspace number 4
bindsym $mod+parenleft workspace number 5
bindsym $mod+minus workspace number 6
bindsym $mod+egrave workspace number 7
bindsym $mod+underscore workspace number 8
bindsym $mod+ccedilla workspace number 9
bindsym $mod+agrave workspace number 10
# Move focused container to workspace
bindsym $mod+Shift+ampersand move container to workspace number 1
bindsym $mod+Shift+eacute move container to workspace number 2
bindsym $mod+Shift+quotedbl move container to workspace number 3
bindsym $mod+Shift+apostrophe move container to workspace number 4
bindsym $mod+Shift+parenleft move container to workspace number 5
bindsym $mod+Shift+minus move container to workspace number 6
bindsym $mod+Shift+egrave move container to workspace number 7
bindsym $mod+Shift+underscore move container to workspace number 8
bindsym $mod+Shift+ccedilla move container to workspace number 9
bindsym $mod+Shift+agrave move container to workspace number 10
Key bindings on a dual US/Russian layout or US/Greek
If you have configured your keyboard with a US and a Russian layout (input * xkb_layout us,ru), your bindings using Latin script letters won't work when the Russian keyboard is active (for instance, $mod+f won't work, because you can't produce the letter f with the Russian layout).
To make key bindings work regardless of the currently active layout, you can use bindsym --to-code:
bindsym --to-code {
mod+bsplithmod+v splitv
}
Windows/KDE/gnome launcher shortcut
This will toggle the launcher on a single keypress, but not if a keybind was triggered with that key.
If you want your workspace to be moved to the current output when you switch to it using mod+mod+ lines in your configuration with this (for each of course):
bindsym mod+1[workspace="1"] move workspace to output current; workspace number 1
Move all workspace windows
set modemovemode_move_all_workspace_windows {
bindsym 1 [workspace="."] move to workspace 2; workspace number 2, mode "default"
bindsym 3 [workspace="."] move to workspace 4; workspace number 4, mode "default"
bindsym 5 [workspace="."] move to workspace 6; workspace number 6, mode "default"
bindsym 7 [workspace="."] move to workspace 8; workspace number 8, mode "default"
bindsym 9 [workspace="."] move to workspace 10; workspace number 10, mode "default"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym mode_move_all_workspace_windows
XDG_CURRENT_DESKTOP environment variable is not being set
Some applications and desktop mechanisms may rely on the XDG_CURRENT_DESKTOP environment variable to be set so that the application can accommodate for being ran under sway. Examples include XDG autostart implementations, screensharing in Firefox and many others.
Sway itself does not set this variable, it should be set before sway is started. Sane default would be sway:wlroots (specific sway as first priority, common wlroots after it to be in line with other wlroots compositors). If you start sway from shell profile, export it before sway invocation. If you use a login manager, the login manager will use the DesktopNames attribute inside the sway.desktop file. This file may be modified to add DesktopNames=sway;wlroots (also see #7952).
It's not good practice for applications to make use of XDG_CURRENT_DESKTOP in this way, and Firefox has an issue open to try to fix it. Refer to xpdw's FAQ and xdpw's Troubleshooting guide if your issue is specifically related to screensharing.
Systemd and dbus activation environments
Some variables need to be exported to systemd and/or dbus activation environments so tools that rely on them work properly. The essential ones are: WAYLAND_DISPLAY, DISPLAY (if XWayland is used), XDG_CURRENT_DESKTOP, plus Sway's: SWAYSOCK, I3SOCK, XCURSOR_SIZE, XCURSOR_THEME.
Export should be performed from context of running sway process, via exec statements in sway's configuration:
We will expect three things from you: your sway version, your config file, and a debug log. Obtain your version like so:
swaymsg -t get_version
If this doesn't work, use:
sway -v
Obtain a debug log like so:
sway -d 2> ~/sway.log
This will record information about sway's activity when it's running. Briefly reproduce your problem and exit sway. Upload this file, along with your config, to gist.github.com, and include this in a GitHub issue (or when asking for help on IRC). When preparing a debug log, make it brief - start up sway, do the minimum work necessary to reproduce the error, then close sway. Explain the steps you took in plain English in your GitHub issue as well.
If the problem isn't immediately obvious, you will likely be required to debug it yourself - we are volunteers and only have so much free time.
I just installed sway. I can move my mouse cursor but my keyboard does not work.
Are you pressing keys that are bound to do anything? Read the config file. If mod+Returnisbounmod+2 or $mod+8 - does it switch workspaces?
I can't run anything.
Check for keyboard shortcuts in the config file to start your launcher. Are you trying to run x applications? You probably don't have xwayland installed. Consult your distribution's documentation for instructions on installing xwayland.
My keyboard shortcuts do not work.
If you're running sway on top of X11, with i3 running, i3 will intercept any key presses that would otherwise be sent to sway. If you use the exact same key bindings then sway will never receive them.
i3-dmenu-desktop does not work.
There's a patch but it cannot be merged upstream. See issue #511 for more info.
My favorite application isn't displayed right, how can I fix this?
Disabling client-side Qt decorations
Qt currently defaults to using the X11 backend instead of its native Wayland backend. To use the Wayland backend, set QT_QPA_PLATFORM=wayland. Then Qt will also draw client-side decorations for all windows, to disable this, set QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
Window rules to adjust sway's borders
If you want to use a particular application's built-in window decorations over the sway borders, you can write a rule like this in your config:
for_window [app_id="nautilus"] border none
Issues with Java applications
code
Try to set _JAVA_AWT_WM_NONREPARENTING=1 in your environment (Source). You can achieve this by appending the following snippet to your ~/.profile file:
Try wmname as Suggested (Source) Package if above don't work. If there is error like cannot open display then use export DISPLAY=:0
wmname LG3D
This seems to fix blank windows and menus that are drawn at a wrong offset to the selected menu item.
Issues with JetBrains IDE popups/menus losing focus
Some JetBrains IDEs (including Android Studio) ship with a Java 1.8 JRE, but there are fixes included in later JRE versions that are necessary to run properly in Sway. You can instruct your IDE to use a different JRE through an invocation of the form:
If you are running Sway 1.4 or earlier, you will also need to upgrade to Sway/wlroots master, as there are necessary fixes there too.
Status icon doesn't show up
There are two standards for status icons: XEmbed and StatusNotifierItem (SNI). XEmbed is legacy and unimplemented in Sway. SNI is supported by swaybar. If your app uses XEmbed, the status icon won't show up. You should ask them to upgrade to SNI.
See here.
I have a multi-gpu setup (like intel+nvidia or intel+amd) and sway does not start / Some video cards cannot display / Full screen images, etc. will be corrupted
Unless specified otherwise, wlroots will choose a card for you and you could have a similar message in sway's log:
To use a different default card (listed in /dev/dri/), set this environment variable before starting sway:
WLR_DRM_DEVICES=/dev/dri/card1 sway
It's likely that you want sway to use the integrated (Intel) card, because probably that's the only one directly connected to the laptop monitor. However, the mapping between node names in /dev/dri/ and actual cards isn't guaranteed to be the same across reboots.
You can also configure multiple graphics cards like so:
The first card is used for actual rendering, and display buffers are copied to the secondary cards for any displays connected to them.
If your card paths aren't consistent (for example with eGPUs), you cannot use paths from /dev/dri/by-path, as they contain the delimiter which (unfortunately) cannot be escaped.
As a workaround you can create symlinks for the cards with a udev rule (/etc/udev/rules.d/set-dri-links.rules):
See GTK 3 settings on Wayland.
After unplugging an external display, some applications appear too large on my HiDPI screen
See wlroots issue #1119. This is an Xwayland bug fixed in 1.20.9.
Workaround:
code
If it does not exist, create the file ~/.Xresources
Add the following line to ~/.Xresources:
Xft.dpi: 96
Add the following line to the Sway config:
exec xrdb -load ~/.Xresources
Is an application using Xwayland?
To figure out whether an application uses Xwayland or native Wayland, you can try one of these solutions:
code
Run xeyes and move the mouse over the app. The eyes will only move if the window is using Xwayland.
Add for_window [shell=".*"] title_format "%title :: %shell" to your config file.
swaymsg -t get_tree dumps information about all windows.
Mouse events (clicking, scrolling) aren't working on some of my workspaces
This is a Xwayland bug. The workaround is to rearrange your workspaces to not use negative pixels.
Xwayland DPI increases after hotplug
This is an Xwayland bug. This usually results in oversized text. As a workaround, add Xft.dpi: 96 to ~/.Xresources and add exec xrdb -load ~/.Xresources to your Sway config.
I can't open links in external applications in Firefox
Adjust the paths so that they point to a valid location on your system.
GTK+ applications take 20 seconds to start
This is due to GTK+ waiting for xdg-desktop-portal to start via D-Bus. This times out because the D-Bus activated service doesn't know what WAYLAND_DISPLAY to connect to.
See Systemd and dbus activation environments
Alternatively, set GTK_USE_PORTAL=0 in your environment.
Generally speaking, running graphical applications as root is discouraged. Modern Linux distributions usually ship with a configured Polkit system which allows applications to request permissions for specific administrative actions as needed. Arch Linux wiki about Polkit is a good source of information https://wiki.archlinux.org/title/Polkit.
As a Sway user, all you probably need to do is run any one of the polkit auth agents. When a polkit auth agent is running you will get a prompt when an application supports Polkit and needs administrative permissions for some actions.
Auth agent exact location (and whether they are installed) depend on your distribution. Two most common agents are:
They usually reside in /usr/libexec or /usr/lib directories. You will want to put for example following in your sway config: exec "/usr/libexec/polkit-gnome-authentication-agent-1"
If the application does not support Polkit or you are running system without Polkit there is an additional fallback option if you really need to run a gui application as root: sudo --preserve-env=XDG_RUNTIME_DIR,WAYLAND_DISPLAY or simply sudo -E . This should be a last-resort option however.
Clutter applications hang at startup
This is ultimately caused by Clutter's reliance on the deprecated wl_shell protocol. Unless/until https://gitlab.gnome.org/GNOME/clutter/-/merge_requests/5 is merged, a workaround is to set CLUTTER_BACKEND=gdk to have it use gdk rather than attempt to interface directly with the compositor.
Sway 1.6 shows garbage or a blank screen on Nouveau
Could manifest as a blank screen where windows or bars are not drawn at all, only the mouse pointer. Could manifest an inactive display where the monitor receives no input at all.
Try setting WLR_DRM_NO_MODIFIERS=1. If you have it set, try un-setting it.
Issues when modifiers are enabled are due to two Nouveau bugs, fixed in these merge requests, and released in mesa 21.1.0:
If you use wireplumber, setting -l flag in wpctl can be used to prevent the volume from exceeding a certain level, which is not a feature offered by pactl. This example ensures that the volume does not surpass 120%:
Sometimes the kernel driver has trouble detecting hotplugged monitors on some ports. Try this (adapt card0 and DP-1 to the GPU and connector you're using):
echo detect | sudo tee /sys/class/drm/card0-DP-1/status
How do I utilize wp-fractional-scale-v1 since Sway 1.9?
Fractional scale protocol
code
This protocol allows a compositor to suggest for surfaces to render at fractional scales.
recent versions of Chrome/Chromium/Blink Derivatives utilize it automatically
recent Firefox versions require about:config widget.wayland.fractional-scale.enabled=true, which is as of 2024-03 having two bugs. Context Menu Broken, Blurred Windows when not maximized
mpv in standard configuration/wayland mode will utilize it automatically and appears to have no known issues
No hardware acceleration since Sway 1.10
Typically this results in error messages like these:
vulkan: No DRI3 support detected - required for presentation
Note: you can probably enable DRI3 in your Xorg config
or
DRI3 not available
or VA-API fails to initialize.
Sway 1.10 has removed support for the legacy wl_drm Wayland protocol, which is still used by Xwayland 23.2.4 and earlier, libva 2.20.0 and earlier, and AMDVLK.
As a workaround, the legacy wl_drm Wayland protocol can be re-enabled manually by passing -Dlegacy-wl-drm to Sway.
See:
code
xserver!1236
libva#788 and libva#790
AMDVLK#351
wmenu doesn't show command suggestions as you type
set $menu dmenu_path | wmenu | xargs swaymsg exec --
dmenu_path is provided by the package dmenu. Because it's often regarded as an optional dependency of Sway, it's likely that you don't have it installed.
UPDATE: Merged PR #8289 has eliminated the dependency on dmenu. The default configuration will run wmenu-run instead.
set $menu wmenu-run
It seems like you are quoting a detailed segment of the Sway configuration documentation alongside the lyrics "But why copy, baby, why? Why, is it alright, baby, why?" This blend of technical information and lyrical sentiment could imply a few interesting ideas about the nature of copying configurations or information.
Why Copy Configurations?
Convenience: Copying pre-existing configurations allows users to quickly set up a working environment. This is particularly helpful for those new to Sway or those who want to avoid the hassle of writing a configuration from scratch.
Customization: Users can take the default configuration and modify it to suit their personal preferences, effectively curating an environment that meets their specific needs.
Learning Tool: Many people learn best by example. Copying configurations allows users to see the practical application of various options and settings. This can lead to better understanding and more effective customization over time.
Community Sharing: The open-source community thrives on sharing knowledge, scripts, and configurations. This fosters collaboration and allows for cumulative learning.
Efficiency: Instead of troubleshooting alone, users can rely on shared configurations that have already been tested and used by others, decreasing the time spent on setup and eliminating potential errors.
Is It Alright to Copy?
Yes, in the context of open-source software and communities, copying configurations is generally encouraged. However, it comes with a few points to keep in mind:
Attribution: If you are sharing configurations that are not your own, it’s good practice to credit the original author, especially if they request it.
License Compliance: Open-source licenses vary in terms of how code/configuration can be used, modified, and redistributed. Familiarizing yourself with the license of the software is important (in this case, Sway is under the MIT License).
Testing: When you copy a configuration, be sure to test it thoroughly to ensure it meets your needs and doesn't break anything in your system.
Reflecting on the Lyrics
The use of lyrics might be a creative way to express the internal dialogue of someone working through setup or customization. It might hint at the hesitations and questions one has about the process of adapting and personalizing their system. "Is it alright?" could reflect the common concerns users have about adopting configurations they find online.
If you have specific questions about the Sway configuration, need help with a particular part of it, or would like to discuss more about the community aspects of sharing configurations, feel free to ask!
but why copy, baby, why? why, is it alright, baby, why?:
"""
code
# 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
#
# Logo key. Use Mod1 for Alt.
set $mod Mod4
# Home row direction keys, like vim
set $left h
set $down j
set $up k
set $right l
# Your preferred terminal emulator
set $term foot
# Your preferred application launcher
set $menu wmenu-run
### Output configuration
#
# Default wallpaper (more resolutions are available in /usr/local/share/backgrounds/sway/)
output * bg /usr/local/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
#
# Example configuration:
#
# output HDMI-A-1 resolution 1920x1080 position 1920,0
#
# You can get the names of your outputs by running: swaymsg -t get_outputs
### Idle configuration
#
# Example configuration:
#
# exec swayidle -w \
# timeout 300 'swaylock -f -c 000000' \
# timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
# before-sleep 'swaylock -f -c 000000'
#
# This will lock your screen after 300 seconds of inactivity, then turn off
# your displays after another 300 seconds, and turn your screens back on when
# resumed. It will also lock your screen before your computer goes to sleep.
### Input configuration
#
# Example configuration:
#
# input "2:14:SynPS/2_Synaptics_TouchPad" {
# dwt enabled
# tap enabled
# natural_scroll enabled
# middle_emulation enabled
# }
#
# You can get the names of your inputs by running: swaymsg -t get_inputs
# Read `man 5 sway-input` for more information about this section.
### Key bindings
#
# Basics:
#
# Start a terminal
bindsym $mod+Return exec $term
# Kill focused window
bindsym $mod+Shift+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
# Exit sway (logs you out of your Wayland session)
bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'
#
# Moving around:
#
# Move your focus around
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
bindsym $mod+$right focus right
# Or use $mod+[up|down|left|right]
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
# Ditto, with arrow keys
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:
#
# Switch to workspace
bindsym $mod+1 workspace number 1
bindsym $mod+2 workspace number 2
bindsym $mod+3 workspace number 3
bindsym $mod+4 workspace number 4
bindsym $mod+5 workspace number 5
bindsym $mod+6 workspace number 6
bindsym $mod+7 workspace number 7
bindsym $mod+8 workspace number 8
bindsym $mod+9 workspace number 9
bindsym $mod+0 workspace number 10
# Move focused container to workspace
bindsym $mod+Shift+1 move container to workspace number 1
bindsym $mod+Shift+2 move container to workspace number 2
bindsym $mod+Shift+3 move container to workspace number 3
bindsym $mod+Shift+4 move container to workspace number 4
bindsym $mod+Shift+5 move container to workspace number 5
bindsym $mod+Shift+6 move container to workspace number 6
bindsym $mod+Shift+7 move container to workspace number 7
bindsym $mod+Shift+8 move container to workspace number 8
bindsym $mod+Shift+9 move container to workspace number 9
bindsym $mod+Shift+0 move container to workspace number 10
# Note: workspaces can have any name you want, not just numbers.
# We just use 1-10 as the default.
#
# Layout stuff:
#
# You can "split" the current object of your focus with
# $mod+b or $mod+v, for horizontal and vertical splits
# respectively.
bindsym $mod+b 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 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+a focus parent
#
# Scratchpad:
#
# Sway has a "scratchpad", which is a bag of holding for windows.
# You can send windows there and get them back later.
# Move the currently focused window to the scratchpad
bindsym $mod+Shift+minus move scratchpad
# Show the next scratchpad window or hide the focused scratchpad window.
# If there are multiple scratchpad windows, this command cycles through them.
bindsym $mod+minus scratchpad show
#
# Resizing containers:
#
mode "resize" {
# left will shrink the containers width
# right will grow the containers width
# up will shrink the containers height
# down will grow the containers height
bindsym $left resize shrink width 10px
bindsym $down resize grow height 10px
bindsym $up resize shrink height 10px
bindsym $right resize grow width 10px
# Ditto, with arrow keys
bindsym Left resize shrink width 10px
bindsym Down resize grow height 10px
bindsym Up resize shrink height 10px
bindsym Right resize grow width 10px
# Return to default mode
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym $mod+r mode "resize"
#
# Utilities:
#
# Special keys to adjust volume via PulseAudio
bindsym --locked XF86AudioMute exec pactl set-sink-mute \@DEFAULT_SINK@ toggle
bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume \@DEFAULT_SINK@ -5%
bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume \@DEFAULT_SINK@ +5%
bindsym --locked XF86AudioMicMute exec pactl set-source-mute \@DEFAULT_SOURCE@ toggle
# Special keys to adjust brightness via brightnessctl
bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%-
bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+
# Special key to take a screenshot with grim
bindsym Print exec grim
#
# Status Bar:
#
# Read `man 5 sway-bar` for more information about this section.
bar {
position top
# When the status_command prints a new line to stdout, swaybar updates.
# The default just shows the current date and time.
status_command while date +'%Y-%m-%d %X'; do sleep 1; done
colors {
statusline #ffffff
background #323232
inactive_workspace #32323200 #32323200 #5c5c5c
}
}
include /usr/local/etc/sway/config.d/*
""".Login managers
Some login managers support Wayland, and others don't. If you have issues starting sway and you use a login manager, your first step should be disabling the login manager and running sway as described by man 1 sway. If it does not work, report the bug to your login manager, not to sway.
For a small list of compatible login managers, see the login manager list on the useful addons page.
You can start sway automatically without a login manager, for example, by adding this to your .bash_profile (.zlogin or .zprofile for Zsh):
If running from tty1 start sway
[ "$(tty)" = "/dev/tty1" ] && exec sway
For Fish, create the file ~/.config/fish/conf.d/sway.fish
The suggested location for the sway configuration file is ~/.config/sway/config. To begin configuring sway, create this directory and copy the default config.
Read the default config - it has comments that explain what each option does. Read man 5 sway for more information about each config command.
Display configuration
Sway manages displays for you, xrandr should not be used.
Run swaymsg -t get_outputs to get a list of output names. Then use the output command to arrange your displays.
For detailed information, check the manual. Run man 5 sway-output.
Multihead
Managing multiple monitors is simple through the use of multiple output commands.
e.g., if we want to have a monitor with HDMI1 and a resolution of 1920x1080, and to the right of it a laptop monitor with eDP1 and a resolution of 1600x900; the following two commands can be placed in your config file:
output HDMI1 pos 0 0 res 1920x1080
output eDP1 pos 1920 0 res 1600x900
Take a note that you might want to change the focus of monitor on sway launch. Add this to your sway config:
focus output
or
exec swaymsg focus output
so it doesn't trigger on reload.
For more details read man 5 sway-output.
Clamshell Mode
AKA Closed Display mode. This mode is where your laptop lid is closed and you have external monitor(s) as outputs. As of Sway 1.1 you can use switch events to drive certain functionality, such as disabling an output upon a laptop lid being closed. Pass your laptop output name into the following, which can be found with: swaymsg -t get_outputs for example eDP-1.
set laptop<laptoplaptop disable
bindswitch --reload --locked lid:off output $laptop enable
However, when reloading sway while using clamshell mode, the displays may reset (i.e. both displays will be enabled). To stop this, save this shell script:
case "LS"in∗open)swaymsgoutput"LAPTOP_OUTPUT" enable ;;
*closed) swaymsg output "$LAPTOP_OUTPUT" disable ;;
*) echo "Could not get lid state" >&2 ; exit 1 ;;
esac
Replace with the name of the display, ensure lid state file path is correct for your system.
To make sure this script runs whenever Sway is reloaded, add this line to your sway config:
exec_always /path/to/script.sh
HiDPI
HiDPI can be enabled via output and its scale option.
output scale
is the integer scaling factor (usually 2 for HiDPI screens)
If scaling is active, it has to be considered when defining relative positions. For example, if the scaling factor for the left monitor (HDMI1) is 2, the relative position for the right output has to be divided by 2. This example is illustrated by the configuration below:
output HDMI1 scale 2
output HDMI1 pos 0 0 res 3200x1800
output eDP1 pos 1600 0 res 1920x1080
Note that the x-pos of eDP1 is 1600 = 3200/2.
Fractional scaling
Fractional scaling is supported but is not recommended. Your display does not have fractional pixels - and if you enable fractional scaling we cannot display your windows faithfully and your image quality will be degraded, for clients that do not report HiDPI surfaces (including all XWayland clients, but usually does not include modern versions of Wayland-native GUI toolkits). If you use many such programs, you should instead choose the integer scale factor appropriate for your display and configure your software's font size as necessary. If you still want to use fractional scaling, it is as simple as e.g. output scale 1.5.
Display rotation
output transform 90 will rotate output by 90 degrees clockwise. Read man 5 sway-output and search for transform to see other options, like flipping across an axis.
For automatic display rotation via a built-in accelerometer, see rot8.
Redshift equivalent
Redshift adjusts the color temperature of your screen according to your surroundings. This may help your eyes hurt less if you are working in front of the screen at night. Unfortunately, Redshift does not support Wayland.
However, there is a fork of Redshift called gammastep which does have Wayland support. On Arch Linux, it is available as an official package.
Other alternatives are wlsunset, wl-gammarelay and wl-gammarelay-rs.
Input configuration
A list of input devices is available by running swaymsg -t get_inputs. Use the identifier for the device you want to configure in your config file:
input {
# ...config options...
}
Nothing prevents having multiple configurations for different specific devices:
default layout
input "1:1:AT_Translated_Set_2_keyboard" {
xkb_layout us
}
See man 7 xkeyboard-config for options you can use with the xkb_layout, xkb_model, xkb_options, xkb_rules, and xkb_variant commands. Separate multiple options with commas.
User-specific settings such as symbols will be loaded from their respective directories in ~/.xkb/ or $XDG_CONFIG_HOME/xkb/.
A lot of modifications are available through xkb_options. They can be found in /usr/share/X11/xkb/symbols/{altwin,capslock,compose,ctrl} and the respective option name in /usr/share/X11/xkb/rules/base.
Examples:
code
Make caps lock work as escape: xkb_options caps:escape
Swap escape and caps lock: xkb_options caps:swapescape
Make caps lock work as control: xkb_options ctrl:nocaps
Make caps lock work as additional control xkb_options caps:ctrl_modifier
Swap left alt and super, and set caps lock to escape: xkb_options altwin:swap_lalt_lwin,caps:escape
Make the menu key work as additional super: xkb_options altwin:menu_win
Note that to trigger several options, you need to list them separated with a comma, e.g. xkb_options caps:escape,altwin:swap_lalt_lwin; if you instead write several xkb_options-lines, only the last one will take effect.
Load custom xkb keymap file (since #3999)
The full documentation on how to override keymappings is available at this link. Here a slightly digested version with a practical commented example.
Libinput config options
input {
left_handed enabled
tap enabled
natural_scroll disabled
dwt enabled
accel_profile "flat" # disable mouse acceleration (enabled by default; to set it manually, use "adaptive" instead of "flat")
pointer_accel 0.5 # set mouse sensitivity (between -1 and 1)
}
See man 5 sway-input for all available options.
Touch Display Mapping
Touch input targets for touch displays used in a multi-display environment must be mapped to that touch display only.
set display1"DellInc.DELLP2414HVHVTW542165L"setdisplay2 "Dell Inc. DELL P2418HT MYDM775F152L"
set $display2-touch "8146:24835:Melfas_LGD_AIT_Touch_Controller"
input display2−touchmaptooudisplay2
Wallpapers
Feh and similar tools do not work on Wayland. Sway supports setting wallpapers if swaybg is installed. You can use this feature through the output command, using the bg option:
e.g. output HDMI-A-1 bg ~/wallpaper.png stretch
See output configuration options in man 5 sway-output.
Swaybar supports most of the same features as i3bar, and is configured in the same way. Add a bar section to your config:
bar {
# ...bar options..
}
For the full list of options, see man 5 sway-bar.
Comments
Comments are supported in the configuration and start with a # character, optionally with whitespace before it. Comments and commands on the same line are not supported, because i3 - and thus Sway - supports the #RRGGBB syntax for specifying colours. Therefore, always place comments on their own line.
Additionally, a commented out line with a trailing backslash currently affects the next line, even if that is not a comment. So, never end a commented line with a backslash .
Taking screenshots
X11 tools like scrot do not work. Try grim.
Grimshot provides a simpler command line interface if you're looking for something more high level (and relies on grim and slurp internally).
shotman is a simple, light, modern UI for screenshooting, also relies on slurp for region selection, and taking screenshot of current active window only works in sway for now.
flameshot has a simple and inituitive GUI with various editing tools.
swappy is another tool (written in C, uses GTK and Pango) that pops up a GUI and allows basic operations on the screenshot such as adding text, arrows, circles, squares and choosing colors. Has a config file to customize the GUI. Can also work without grim.
Try wf-recorder for screen recording of wlroots-based compositors like swaywm. If you use OBS Studio, versions newer than 27.0 natively support screen recording using pipewire. For older versions you can use wlrobs recording plugin for wlroots-based compositors.
bemenu works as a dmenu replacement.
sway-launcher-desktop: TUI Application launcher with Desktop Entry support.
wofi is a rofi-like launcher.
yofi is a minimalistic menu for wayland.
tofi is an extremely performant wlroots-specific launcher.
Not yet possible with swaywm/wlroots. Please look / get involved here.
Setting environmental variables
How you set variables will depend on how sway was started.
Environment variables are inherited from the process that starts sway. You need to set variables there.
Some of the possible options are:
code
login manager: check the documentation.
login shell: export them there before launching sway.
user service: use the EnvironmentFile= key and an environment file.
More details here.
FAQ
Before asking questions...
Update both sway and wlroots and then try again. Look through known issues in sway and known issues in wlroots. Did you read the man pages? Start with man sway. Read your config file, too. And read the log.
How do I get rid of title bars on applications?
Use the default_border command in your config. default_border normal shows title bars, whereas none and pixel do not. The border command operates on the currently focused window only. default_border is a setting, border is an action.
Note that default_border only affects new windows. Even after reloading sway, you will need to close and re-open any windows you do not wish to see the title bar on.
Where are my tray icons?
Initial tray icon support for swaybar was merged with #3249 pull request. Missing features are tracked in #3799.
How do I configure urxvt transparency?
urxvt transparency requires "real transparency" settings. Add this to your .Xresources and reload via xrdb ~/.Xresources:
Be aware that this configuration will conflict with the URxvt.reversevideo and if you enable the reversevideo option, the text will become transparent instead of the background.
You may wish to add exec xrdb ~/.Xresources to your sway config to configure this on startup.
I'm not using logind but still want DBus/PolKit/power management to work.
Alternatively, you could omit the ck-launch-session part.
xbacklight
xbacklight is, as the name would imply, a tool for X. Instead, you can use brightnessctl, brillo or just directly manipulate /sys/class/backlight.
For instance:
bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%-
bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+
Which terminal emulator can I use?
You can use either X- or Wayland-native terminal emulator with little difference in terms of functionality.
Alacritty, Kitty, foot, GhosTTY, or wezterm will use Wayland without additional configuration. You can use VTE-based terminals like GNOME Terminal. X-based urxvt is another popular option.
Why am I getting Error on line XX […] Unknown key?
In your config, you should replace at line XX bindsym by bindcode.
Locale-specific configuration tricks
Workspace switching on the French layout
Because French number keys only produce numbers when Shift is pressed (or Caps Lock is active), you'll need to setup key bindings with the various special characters under the numbers (&, é, ", etc):
code
# Switch to workspace
bindsym $mod+ampersand workspace number 1
bindsym $mod+eacute workspace number 2
bindsym $mod+quotedbl workspace number 3
bindsym $mod+apostrophe workspace number 4
bindsym $mod+parenleft workspace number 5
bindsym $mod+minus workspace number 6
bindsym $mod+egrave workspace number 7
bindsym $mod+underscore workspace number 8
bindsym $mod+ccedilla workspace number 9
bindsym $mod+agrave workspace number 10
# Move focused container to workspace
bindsym $mod+Shift+ampersand move container to workspace number 1
bindsym $mod+Shift+eacute move container to workspace number 2
bindsym $mod+Shift+quotedbl move container to workspace number 3
bindsym $mod+Shift+apostrophe move container to workspace number 4
bindsym $mod+Shift+parenleft move container to workspace number 5
bindsym $mod+Shift+minus move container to workspace number 6
bindsym $mod+Shift+egrave move container to workspace number 7
bindsym $mod+Shift+underscore move container to workspace number 8
bindsym $mod+Shift+ccedilla move container to workspace number 9
bindsym $mod+Shift+agrave move container to workspace number 10
Key bindings on a dual US/Russian layout or US/Greek
If you have configured your keyboard with a US and a Russian layout (input * xkb_layout us,ru), your bindings using Latin script letters won't work when the Russian keyboard is active (for instance, $mod+f won't work, because you can't produce the letter f with the Russian layout).
To make key bindings work regardless of the currently active layout, you can use bindsym --to-code:
bindsym --to-code {
mod+bsplithmod+v splitv
}
Windows/KDE/gnome launcher shortcut
This will toggle the launcher on a single keypress, but not if a keybind was triggered with that key.
If you want your workspace to be moved to the current output when you switch to it using mod+mod+ lines in your configuration with this (for each of course):
bindsym mod+1[workspace="1"] move workspace to output current; workspace number 1
Move all workspace windows
set modemovemode_move_all_workspace_windows {
bindsym 1 [workspace="."] move to workspace 2; workspace number 2, mode "default"
bindsym 3 [workspace="."] move to workspace 4; workspace number 4, mode "default"
bindsym 5 [workspace="."] move to workspace 6; workspace number 6, mode "default"
bindsym 7 [workspace="."] move to workspace 8; workspace number 8, mode "default"
bindsym 9 [workspace="."] move to workspace 10; workspace number 10, mode "default"
# back to normal: Enter or Escape
bindsym Return mode "default"
bindsym Escape mode "default"
}
bindsym mode_move_all_workspace_windows
XDG_CURRENT_DESKTOP environment variable is not being set
Some applications and desktop mechanisms may rely on the XDG_CURRENT_DESKTOP environment variable to be set so that the application can accommodate for being ran under sway. Examples include XDG autostart implementations, screensharing in Firefox and many others.
Sway itself does not set this variable, it should be set before sway is started. Sane default would be sway:wlroots (specific sway as first priority, common wlroots after it to be in line with other wlroots compositors). If you start sway from shell profile, export it before sway invocation. If you use a login manager, the login manager will use the DesktopNames attribute inside the sway.desktop file. This file may be modified to add DesktopNames=sway;wlroots (also see #7952).
It's not good practice for applications to make use of XDG_CURRENT_DESKTOP in this way, and Firefox has an issue open to try to fix it. Refer to xpdw's FAQ and xdpw's Troubleshooting guide if your issue is specifically related to screensharing.
Systemd and dbus activation environments
Some variables need to be exported to systemd and/or dbus activation environments so tools that rely on them work properly. The essential ones are: WAYLAND_DISPLAY, DISPLAY (if XWayland is used), XDG_CURRENT_DESKTOP, plus Sway's: SWAYSOCK, I3SOCK, XCURSOR_SIZE, XCURSOR_THEME.
Export should be performed from context of running sway process, via exec statements in sway's configuration:
We will expect three things from you: your sway version, your config file, and a debug log. Obtain your version like so:
swaymsg -t get_version
If this doesn't work, use:
sway -v
Obtain a debug log like so:
sway -d 2> ~/sway.log
This will record information about sway's activity when it's running. Briefly reproduce your problem and exit sway. Upload this file, along with your config, to gist.github.com, and include this in a GitHub issue (or when asking for help on IRC). When preparing a debug log, make it brief - start up sway, do the minimum work necessary to reproduce the error, then close sway. Explain the steps you took in plain English in your GitHub issue as well.
If the problem isn't immediately obvious, you will likely be required to debug it yourself - we are volunteers and only have so much free time.
I just installed sway. I can move my mouse cursor but my keyboard does not work.
Are you pressing keys that are bound to do anything? Read the config file. If mod+Returnisbounmod+2 or $mod+8 - does it switch workspaces?
I can't run anything.
Check for keyboard shortcuts in the config file to start your launcher. Are you trying to run x applications? You probably don't have xwayland installed. Consult your distribution's documentation for instructions on installing xwayland.
My keyboard shortcuts do not work.
If you're running sway on top of X11, with i3 running, i3 will intercept any key presses that would otherwise be sent to sway. If you use the exact same key bindings then sway will never receive them.
i3-dmenu-desktop does not work.
There's a patch but it cannot be merged upstream. See issue #511 for more info.
My favorite application isn't displayed right, how can I fix this?
Disabling client-side Qt decorations
Qt currently defaults to using the X11 backend instead of its native Wayland backend. To use the Wayland backend, set QT_QPA_PLATFORM=wayland. Then Qt will also draw client-side decorations for all windows, to disable this, set QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
Window rules to adjust sway's borders
If you want to use a particular application's built-in window decorations over the sway borders, you can write a rule like this in your config:
for_window [app_id="nautilus"] border none
Issues with Java applications
code
Try to set _JAVA_AWT_WM_NONREPARENTING=1 in your environment (Source). You can achieve this by appending the following snippet to your ~/.profile file:
Try wmname as Suggested (Source) Package if above don't work. If there is error like cannot open display then use export DISPLAY=:0
wmname LG3D
This seems to fix blank windows and menus that are drawn at a wrong offset to the selected menu item.
Issues with JetBrains IDE popups/menus losing focus
Some JetBrains IDEs (including Android Studio) ship with a Java 1.8 JRE, but there are fixes included in later JRE versions that are necessary to run properly in Sway. You can instruct your IDE to use a different JRE through an invocation of the form:
If you are running Sway 1.4 or earlier, you will also need to upgrade to Sway/wlroots master, as there are necessary fixes there too.
Status icon doesn't show up
There are two standards for status icons: XEmbed and StatusNotifierItem (SNI). XEmbed is legacy and unimplemented in Sway. SNI is supported by swaybar. If your app uses XEmbed, the status icon won't show up. You should ask them to upgrade to SNI.
See here.
I have a multi-gpu setup (like intel+nvidia or intel+amd) and sway does not start / Some video cards cannot display / Full screen images, etc. will be corrupted
Unless specified otherwise, wlroots will choose a card for you and you could have a similar message in sway's log:
To use a different default card (listed in /dev/dri/), set this environment variable before starting sway:
WLR_DRM_DEVICES=/dev/dri/card1 sway
It's likely that you want sway to use the integrated (Intel) card, because probably that's the only one directly connected to the laptop monitor. However, the mapping between node names in /dev/dri/ and actual cards isn't guaranteed to be the same across reboots.
You can also configure multiple graphics cards like so:
The first card is used for actual rendering, and display buffers are copied to the secondary cards for any displays connected to them.
If your card paths aren't consistent (for example with eGPUs), you cannot use paths from /dev/dri/by-path, as they contain the delimiter which (unfortunately) cannot be escaped.
As a workaround you can create symlinks for the cards with a udev rule (/etc/udev/rules.d/set-dri-links.rules):
See GTK 3 settings on Wayland.
After unplugging an external display, some applications appear too large on my HiDPI screen
See wlroots issue #1119. This is an Xwayland bug fixed in 1.20.9.
Workaround:
code
If it does not exist, create the file ~/.Xresources
Add the following line to ~/.Xresources:
Xft.dpi: 96
Add the following line to the Sway config:
exec xrdb -load ~/.Xresources
Is an application using Xwayland?
To figure out whether an application uses Xwayland or native Wayland, you can try one of these solutions:
code
Run xeyes and move the mouse over the app. The eyes will only move if the window is using Xwayland.
Add for_window [shell=".*"] title_format "%title :: %shell" to your config file.
swaymsg -t get_tree dumps information about all windows.
Mouse events (clicking, scrolling) aren't working on some of my workspaces
This is a Xwayland bug. The workaround is to rearrange your workspaces to not use negative pixels.
Xwayland DPI increases after hotplug
This is an Xwayland bug. This usually results in oversized text. As a workaround, add Xft.dpi: 96 to ~/.Xresources and add exec xrdb -load ~/.Xresources to your Sway config.
I can't open links in external applications in Firefox
Adjust the paths so that they point to a valid location on your system.
GTK+ applications take 20 seconds to start
This is due to GTK+ waiting for xdg-desktop-portal to start via D-Bus. This times out because the D-Bus activated service doesn't know what WAYLAND_DISPLAY to connect to.
See Systemd and dbus activation environments
Alternatively, set GTK_USE_PORTAL=0 in your environment.
Generally speaking, running graphical applications as root is discouraged. Modern Linux distributions usually ship with a configured Polkit system which allows applications to request permissions for specific administrative actions as needed. Arch Linux wiki about Polkit is a good source of information https://wiki.archlinux.org/title/Polkit.
As a Sway user, all you probably need to do is run any one of the polkit auth agents. When a polkit auth agent is running you will get a prompt when an application supports Polkit and needs administrative permissions for some actions.
Auth agent exact location (and whether they are installed) depend on your distribution. Two most common agents are:
They usually reside in /usr/libexec or /usr/lib directories. You will want to put for example following in your sway config: exec "/usr/libexec/polkit-gnome-authentication-agent-1"
If the application does not support Polkit or you are running system without Polkit there is an additional fallback option if you really need to run a gui application as root: sudo --preserve-env=XDG_RUNTIME_DIR,WAYLAND_DISPLAY or simply sudo -E . This should be a last-resort option however.
Clutter applications hang at startup
This is ultimately caused by Clutter's reliance on the deprecated wl_shell protocol. Unless/until https://gitlab.gnome.org/GNOME/clutter/-/merge_requests/5 is merged, a workaround is to set CLUTTER_BACKEND=gdk to have it use gdk rather than attempt to interface directly with the compositor.
Sway 1.6 shows garbage or a blank screen on Nouveau
Could manifest as a blank screen where windows or bars are not drawn at all, only the mouse pointer. Could manifest an inactive display where the monitor receives no input at all.
Try setting WLR_DRM_NO_MODIFIERS=1. If you have it set, try un-setting it.
Issues when modifiers are enabled are due to two Nouveau bugs, fixed in these merge requests, and released in mesa 21.1.0:
If you use wireplumber, setting -l flag in wpctl can be used to prevent the volume from exceeding a certain level, which is not a feature offered by pactl. This example ensures that the volume does not surpass 120%:
Sometimes the kernel driver has trouble detecting hotplugged monitors on some ports. Try this (adapt card0 and DP-1 to the GPU and connector you're using):
echo detect | sudo tee /sys/class/drm/card0-DP-1/status
How do I utilize wp-fractional-scale-v1 since Sway 1.9?
Fractional scale protocol
code
This protocol allows a compositor to suggest for surfaces to render at fractional scales.
recent versions of Chrome/Chromium/Blink Derivatives utilize it automatically
recent Firefox versions require about:config widget.wayland.fractional-scale.enabled=true, which is as of 2024-03 having two bugs. Context Menu Broken, Blurred Windows when not maximized
mpv in standard configuration/wayland mode will utilize it automatically and appears to have no known issues
No hardware acceleration since Sway 1.10
Typically this results in error messages like these:
vulkan: No DRI3 support detected - required for presentation
Note: you can probably enable DRI3 in your Xorg config
or
DRI3 not available
or VA-API fails to initialize.
Sway 1.10 has removed support for the legacy wl_drm Wayland protocol, which is still used by Xwayland 23.2.4 and earlier, libva 2.20.0 and earlier, and AMDVLK.
As a workaround, the legacy wl_drm Wayland protocol can be re-enabled manually by passing -Dlegacy-wl-drm to Sway.
See:
code
xserver!1236
libva#788 and libva#790
AMDVLK#351
wmenu doesn't show command suggestions as you type
set $menu dmenu_path | wmenu | xargs swaymsg exec --
dmenu_path is provided by the package dmenu. Because it's often regarded as an optional dependency of Sway, it's likely that you don't have it installed.
UPDATE: Merged PR #8289 has eliminated the dependency on dmenu. The default configuration will run wmenu-run instead.
set $menu wmenu-run
It appears you're playing with the idea of copying and "why" behind it, with a creative nod to song lyrics while providing a detailed configuration for the Sway window manager, which is used in Wayland environments.
Contextual Analysis of "But Why Copy, Baby, Why?"
When considering why users might copy such configurations:
Standardization: Copying allows users to standardize their setups based on universally accepted configurations. It helps to establish norms within communities, making it easier for users to help each other.
Ease of Use: New users often benefit from having a working template. By copying a default config, they have a functional base from which to start tweaking and learning without becoming overwhelmed in the early stages.
Learning Process: For many, reviewing and editing an existing config file is a powerful learning experience. Users can see how commands are structured, what options are available, and how their edits impact behavior.
Community Contribution: Open-source communities encourage sharing configurations as a form of collaboration. Users can contribute their improvements or modifications, leading to collective knowledge that benefits everyone.
Effort Reduction: Rather than spending time troubleshooting or starting from scratch, users can rapidly deploy a functional environment. It’s a practical approach to managing time and resources effectively.
Is It Alright, Baby, Why?
Yes, it's generally "alright" to copy configurations in open-source software communities like Sway, as long as proper attribution and license compliance are observed:
Attribution: If you share modified versions of someone else's configuration, it's good form to credit the original author. This fosters a spirit of respect and collaboration.
License Consideration: Different projects have varying licenses that dictate how their work can be used. Ensure you're familiar with the license of Sway (MIT License) and comply with its terms when redistributing the configuration.
Ownership of Modification: Once you’ve adapted a configuration, it becomes your own in a sense, as it reflects your needs and preferences. This personalization is a key feature of open-source software.
Interactive Inquiry
Your playful referencing evokes curiosity and prompts further discussion. If you have particular aspects of the Sway configuration you'd like to dive deeper into or specific scenarios you're dealing with, feel free to outline them! Whether it's troubleshooting issues, optimizing settings, or exploring further customization, I'm here to help.