Update for sway 1.0

Drew DeVault 2018-10-03 08:01:29 -04:00
parent 6dc5d806e9
commit 076aa724b4
3 changed files with 88 additions and 91 deletions

@ -1,4 +1,4 @@
Note: these instructions are community-maintained and not supported by sway.
Note: these instructions are community-maintained, are not supported by sway, and *are known to be outdated*.
This document will guide you through installing sway on Debian stretch (stable). Please edit this page if you spot inaccuracies or grammar errors.

@ -1,5 +0,0 @@
* Check if the program is also displayed wrong in [orbment](https://github.com/Cloudef/orbment). When that is the case, the bug is probably in [wlc](https://github.com/Cloudef/wlc) (the library, that both orbment and sway use, written by the author of orbment).
* [xwayland_debuginfo.sh](https://gist.github.com/robotanarchy/33bf7f6fa7b5e9f88624) dumps `xprop` information for all opened windows. Read it for usage instructions.
* Read [wlc.c](https://github.com/Cloudef/wlc/blob/a9deba1b03b42be056a271b0af8afe32aef89a1c/src/xwayland/xwm.c#L469-L484) to find out, how it maps the xprop-data to window types (maybe you can fix the bug there?)
* *TODO: add places where to look in the sway source*
* Fix the bug, or at least make a wlc or sway bug report with what you found out

172
Home.md

@ -14,11 +14,11 @@ All proprietary graphics drivers are unsupported. This includes the Nvidia propr
### Login managers
Some login managers support Wayland, others don't, and none are supported by Sway. It's recommended that you simply login at a getty and run `sway` from the shell, or configure a `.bashrc` or similar to start sway upon logging into the getty.
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 works, report the bug to your login manager, not to sway.
For example. In order to start Sway automatically after logging into tty1, one can place the following into their `.bashrc`:
You can start sway automatically without a login manager, for example, by adding this to your `.bashrc`:
``` bash
```bash
# If running trom tty1 start sway
if [ $(tty) = "/dev/tty1" ]; then
sway
@ -30,13 +30,13 @@ fi
The suggested location for the sway configuration file is ~/.config/sway/config. To begin configuring sway, create this directory and copy the default config.
```bash
```sh
mkdir -p ~/.config/sway
cp /etc/sway/config ~/.config/sway/
$EDITOR ~/.config/sway/config
```
Read `man 5 sway` for more information about the 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
@ -50,117 +50,136 @@ For detailed information, check the manual. Run `man 5 sway` and search for `out
Managing multiple monitors is simple through the use of multiple `output` commands.
e.g., if we want to have a monitor with \<name\> HDMI1 and a resolution of 1920x1080, and to the right of it a laptop monitor with \<name\> eDP1 and a resolution of 1600x900; the following two commands can be placed in our config file.
e.g., if we want to have a monitor with \<name\> HDMI1 and a resolution of 1920x1080, and to the right of it a laptop monitor with \<name\> eDP1 and a resolution of 1600x900; the following two commands can be placed in our config file:
```
output HDMI1 pos 0 0 res 1920x1080
output eDP1 pos 1920 0 res 1600x900
```
For more details read `man 5 sway` and search for `output`.
#### HiDPI
HiDPI can be enabled via `output` and its **scale** option.
`output <name> scale <I>`
\<I\> is the integer scaling factor (usually 2 for HiDPI screens)
&lt;I&gt; 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:
```bash
```
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. 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 <name> scale 1.5`.
#### Display rotation
Rotation is not currently supported. This needs to be implemented in WLC. See https://github.com/Cloudef/wlc/issues/86.
`output <name> transform 90` will rotate output `<name>` by 90 degrees clockwise. Read `man 5 sway` and search for `transform` to see other options, like flipping across an axis.
### Input configuration
#### Keyboard layout
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:
You have to set the keyboard layout before starting sway, using environmental variables such as `XKB_DEFAULT_LAYOUT=de sway`. It is also possible to set other options known from `setxkbmap` with the environment variables `XKB_DEFAULT_MODEL`, `XKB_DEFAULT_LAYOUT`, `XKB_DEFAULT_VARIANT`, `XKB_DEFAULT_OPTIONS`. To set these options, it is best to launch sway with a script.
In the following example, right before launching sway, this script sets environment variables that enable switching between the American and German layouts, without dead keys, using the hotkey <kbd>Alt</kbd>-<kbd>Shift</kbd>:
```bash
export XKB_DEFAULT_LAYOUT=us,de
export XKB_DEFAULT_VARIANT=,nodeadkeys
export XKB_DEFAULT_OPTIONS=grp:alt_shift_toggle,
sway
```
input <identifier> {
# ...config options...
}
```
Supported parameters are defined in `/usr/share/X11/xkb/symbols/*`.
See `man 5 sway-input` for a summary of the available options.
* Make caps lock work as escape: `export XKB_DEFAULT_OPTIONS=caps:escape`
* Swap escape and caps lock: `export XKB_DEFAULT_OPTIONS=caps:swapescape`
* Make caps lock work as control: `export XKB_DEFAULT_OPTIONS=ctrl:nocaps`
#### Keyboard layout
```
input <identifier> {
xkb_layout us,de
xkb_variant ,nodeadkeys
xkb_options grp:alt_shift_toggle
}
```
See `man 7 xkeyboard-config` for options you can use with the `xkb_layout`, `xkb_model`, `xkb_options`, `xkb_rules`, and `xkb_variant` commands.
**Examples**:
* 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`
#### Keyboard repeat delay and rate
Set the environment variables `WLC_REPEAT_DELAY`/`WLC_REPEAT_RATE` to the delay/rate in milliseconds before starting sway.
```
input <identifier> {
repeat_delay 500 # ms
repeat_rate 5 # keys per second
}
```
#### Input device configuration
#### Libinput config options
Run `swaymsg -t get_inputs` to find the name of the input device that you want to configure, then add an `input` section to your config. Example config:
```bash
```
input <device name> {
left_handed enabled
tap enabled
natural_scroll disabled
dwt enabled
}
```
See `man sway-input` for all available options.
See `man 5 sway-input` for all available options.
### Wallpapers
Feh and similar tools do not work on Wayland. Sway supports setting wallpapers through the `output` command, using the **bg** option:
e.g., `output HDMI-A-1 bg ~/wallpaper.png stretch`
e.g. `output HDMI-A-1 bg ~/wallpaper.png stretch`
See output configuration options in `man 5 sway`.
### Swaybar configuration
Swaybar follows a very similar configuration to the i3bar. Simply, add a `bar` section to your config:
```shell
# swaybar
bar {
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..
}
```
See also: [Configuring i3bar](https://i3wm.org/docs/userguide.html#_configuring_i3bar) and [i3bar compatibility](https://github.com/SirCmpwn/sway/issues/343).
For the full list of options, see `man 5 sway-bar`.
## Taking screenshots
Read `man swaygrab`.
X11 tools like `scrot` are not supported. Try [grim](https://github.com/emersion/grim).
## FAQ
### Insert any question to this FAQ
### Before asking questions...
Update both sway and wlc and then try again. Look through [known
issues](https://github.com/SirCmpwn/sway/issues) in sway. Look through [known
issues](https://github.com/Cloudef/wlc/issues) in wlc. Did you read the man
pages? We ship detailed man pages, start with `man sway`. Read your config
file, too. And read the log.
Update both sway and wlroots and then try again. Look through [known issues](https://github.com/swaywm/sway/issues) in sway and [known issues](https://github.com/swaywm/wlroots/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. (This command used to be called `new_window`, but that command has been deprecated and will be removed in the future.) `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.
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.
### Where are my tray icons?
Swaybar currently only supports tray icons that implement the StatusNotifierItem (KDE) specification. The older SystemTray specification that uses Xembed is planned, but currently unsupported. If one still wants to use programs that implement the older spec, the KDE helper program `xembedsniproxy` can be used to translate between the two protocols. However, this program is buggy and we will not help you use it until xembed is fully supported.
Swaybar does not currently support tray icons.
### How do I configure urxvt transparency?
urxvt transparency requires "real transparency" settings. Add this to your `.Xresources` and reload via `xrdb ~/.Xresources`:
```
URxvt*depth: 32
URxvt*background: rgba:0000/0000/0200/c800
@ -168,6 +187,8 @@ URxvt*background: rgba:0000/0000/0200/c800
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.
What can I do?
@ -181,7 +202,7 @@ Alternatively, you could omit the `ck-launch-session` part.
### xbacklight
xbacklight is, of course, a tool for X. Instead, you can use [brightnessctl](//github.com/Hummer12007/brightnessctl), [light](//github.com/haikarainen/light) or just directly manipulate `/sys/class/backlight`.
xbacklight is, as the name would imply, a tool for X. Instead, you can use [brightnessctl](//github.com/Hummer12007/brightnessctl), [light](//github.com/haikarainen/light) or just directly manipulate `/sys/class/backlight`.
### Which terminal emulator can I use?
@ -209,7 +230,9 @@ 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](https://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.
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](https://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.
@ -225,32 +248,17 @@ If you're running sway on top of X11, with i3 running, i3 will intercept any key
### i3-dmenu-desktop does not work.
There's a [patch](https://github.com/i3/i3/pull/2265) but it cannot be merged upstream.
See [issue #511](https://github.com/SirCmpwn/sway/issues/521) for more info.
There's a [patch](https://github.com/i3/i3/pull/2265) but it cannot be merged upstream. See [issue #511](https://github.com/swaywm/sway/issues/521) for more info.
You can still apply the patch manually though:
```bash
```sh
wget 'https://patch-diff.githubusercontent.com/raw/i3/i3/pull/2265.patch'
sudo patch -p0 /usr/bin/i3-dmenu-desktop < 2265.patch
```
### `rofi` does not get focus on launch.
`rofi` has an [issue](#431) in X which requires mouse to be moved over it to gain focus after launch. This is planned to be removed in Wayland port (see [upstream discussion](https://github.com/DaveDavenport/rofi/issues/431)).
### My favorite application isn't displayed right, how can I fix this?
#### X-applications
* [Debugging improperly displayed X-applications](https://github.com/SirCmpwn/sway/wiki/Debugging-improperly-displayed-X-applications)
#### Disabling client-side GTK3 decorations
Try one of the following:
* Install a patched GTK3 which removes *CSD* by default (check out what your distro offers; [AUR](https://aur.archlinux.org/packages/?K=gtk3%20csd))
* Patch the application to remove decorations. See [gtk_window_set_decorated](https://developer.gnome.org/gtk3/stable/GtkWindow.html#gtk-window-set-decorated)
* Make an upstream pull-request, that makes decorations optional at runtime.
* Use a CSS hack in `~/.config/gtk-3.0/gtk.css`: `.titlebar.default-decoration { margin: -200px; opacity: 0; }` (this disables titlebars without extra buttons, like gnome terminal's, but not nautilus')
#### 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"`
@ -263,7 +271,7 @@ If you want to use a particular application's built-in window decorations over t
#### Issues with Java applications
* Try to set `_JAVA_AWT_WM_NONREPARENTING=1` in your environment. [Source](https://github.com/SirCmpwn/sway/issues/595)
* Try to set `_JAVA_AWT_WM_NONREPARENTING=1` in your environment. [Source](https://github.com/swaywm/sway/issues/595)
This seems to fix blank windows and menus that are drawn at a wrong offset to the selected menu item.
@ -273,35 +281,29 @@ Use the hook files provided [here](https://github.com/SirCmpwn/sway/wiki/Sway-wi
### I have a multi-gpu setup (like intel+nvidia or intel+amd) and sway does not start
Unless specified otherwise, `wlc` will choose a card for you and you could have a similar message in sway's log:
```
...
10/11/16 20:05:08 - [main.c:43] [wlc] Activating tty
10/11/16 20:05:08 - [main.c:41] [wlc] Connector 0 is not connected or has no modes
10/11/16 20:05:08 - [main.c:41] [wlc] Connector 1 is not connected or has no modes
10/11/16 20:05:08 - [main.c:43] [wlc] become active
10/11/16 20:05:08 - [main.c:43] [wlc] Cleanup wlc
10/11/16 20:05:08 - [handlers.c:911] Compositor is ready, executing cmds in queue
10/11/16 20:05:08 - [main.c:43] [wlc] Closing Xwayland
10/11/16 20:05:08 - [main.c:43] [wlc] Closed drm
10/11/16 20:05:08 - [main.c:43] [wlc] Restoring vt 1 (0x4) (fd 0)
```
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:
Try with a different default card (listed in `/dev/dri/`), for example:
```
WLC_DRM_DEVICE=card1 sway
WLR_DRM_DEVICES=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.
This script detects which is the device path of the integrated card and launches sway accordingly:
```
#! /bin/bash
This script detects which is the device path of the integrated card and launches sway accordingly:
```
#!/bin/sh
val=$(udevadm info -a -n /dev/dri/card1 | grep boot_vga | rev | cut -c 2)
cmd="WLC_DRM_DEVICE=card$val sway"
cmd="WLR_DRM_DEVICES=card$val sway"
eval "$cmd"
```
### Can I use Sway with Gnome?
You can also configure multiple graphics cards like so:
In the X11 world the window manager and desktop environment could be mix and matched. In Wayland it's not as easy to mix different window managers and desktop environments. While some people could use the i3 window manager with the gnome desktop, this is not possible with sway.
```
WLR_DRM_DEVICES=card0,card1 sway
```
The first card is used for actual rendering, and display buffers are copied to the secondary cards for any displays connected to them.