copy the still-somewhat-relevant "using sway" section from the outdated "Debian installation guide" page

Tudor Brindus 2020-12-31 20:34:55 -05:00
parent 391f0684ca
commit bdc4663e38

@ -140,3 +140,45 @@ git checkout 1.0
meson build
sudo ninja -C build install
```
### Using `sway`
If you already have another desktop environment installed, you may be unable to boot to `sway` without messing with your display manager. To prevent your display manager from starting up on boot you can disable it via Systemd:
````
sudo systemctl disable gdm3.service
````
`gdm3` is used as an example here, your display manager may differ.
Alternatively, you may prefer to switch the target environment to use by default from `graphical.target` to `multi-user.target`. More information on how Systemd targets work is described in [this article](https://www.digitalocean.com/community/tutorials/systemd-essentials-working-with-services-units-and-the-journal).
The simple instructions are to first check to see that you are actually using `graphical.target` with the command `systemctl get-default`.
If you are, check to make sure that no critical services will be disabled when changing to `multi-user target`:
````
$ systemctl list-dependencies graphical.target
graphical.target
● ├─accounts-daemon.service
...
● └─multi-user.target
● ├─anacron.service
...
● ├─basic.target
● │ ├─-.mount
...
````
Only items that are children `multi-user.target` will remain active. If there are any essential services that are direct children of `graphical.target` or children of another target that depends on it, you can move their .service file from their appropriate `/lib/systemd/system/<target_name>.target.wants` to the `/lib/systemd/system/multi-user.wants` directory.
You can then change to use the multi-user target:
````
systemctl set-default multi-user.target
````
By changing to the multi-user.target, you will be prompted to log in at a tty. After logging in you can run `sway` to start up your new window manager. If you would like to have sway start automatically on a specific tty, you can configure your `.bash_profile` file to do so:
````
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
exec sway
fi
````
If you are on a single-user system and are used to having your account auto-login, you can configure `getty` to log you into the same tty that you have set to automatically execute sway. See the [Arch Wiki](https://wiki.archlinux.org/index.php/Getty#Automatic_login_to_virtual_console) on this topic. Note that this should only be done if you have some other layer of security such as a password-protected filesystem which is decrypted on boot.