mirror of
https://github.com/swaywm/sway.git
synced 2024-12-03 03:46:53 +00:00
Updated for Buster and made more verbose
parent
0af211468a
commit
a447f11f7f
|
@ -1,20 +1,26 @@
|
|||
<span style="color:red;">Preface: These instructions don't currently work, as "this will need libjson-c-dev >= 0.13 which is currently not in debian buster"</span>
|
||||
## Disclaimers
|
||||
|
||||
Note: these instructions are community-maintained, are not supported by sway, and *are known to be outdated*.
|
||||
Note: these instructions are community-maintained, and are not supported by the `sway` project. They are known to work as of the last edit. It should also be noted that Debian is probably the least friendly mainstream distribution to install `sway` and many of it's affiliated applications on since it relies on building from source and non-stable repositories. You may wish to try it on another distribution first before embarking down this road.
|
||||
|
||||
This document will guide you through installing sway on Debian stretch (stable). Please edit this page if you spot inaccuracies or grammar errors.
|
||||
This document will guide you through installing sway on Debian Buster (stable). Currently `swaywm` IS available in the `experimental` repositories, HOWEVER several dependencies are only available in `sid`. To get `sway` installed with minimal manual compilation, a couple of `experimental` repositories will be added, but to ensure stability, `sid` repositories will be avoided. The application itself and other dependencies are pulled from GitHub.
|
||||
|
||||
We'll first need to install a recent version of Wayland:
|
||||
**Installing packages from source is NOT the Debian way of doing things, and could break the system!** That said, this is the most stable way of getting `sway` on Debian Buster at this time. [Read more here](https://wiki.debian.org/DontBreakDebian#Don.27t_.27make_install.27).
|
||||
|
||||
Please edit this page if you spot inaccuracies, errors, or information that is out-of-date.
|
||||
|
||||
## Installing `xwayland`
|
||||
|
||||
We'll first need to install `xwayland` and other dependencies in order to support the majority of non-wayland applications:
|
||||
|
||||
````
|
||||
sudo apt-get install libgles2-mesa-dev libdrm2 libdrm-dev libegl1-mesa-dev xwayland
|
||||
````
|
||||
Change 'http://http.debian.net/debian' to your mirror of choice.
|
||||
|
||||
## Installing `wlc`
|
||||
|
||||
Next we'll install [Wlc](https://github.com/Cloudef/wlc) and its dependencies:
|
||||
````
|
||||
sudo apt-get install cmake build-essential libinput10 libinput-dev libxkbcommon0 libxkbcommon-dev libudev-dev libxcb-image0 libxcb-image0-dev libxcb-composite0 libxcb-composite0-dev libxcb-xkb1 libxcb-xkb-dev libgbm1 libgbm-dev libdbus-1-dev libsystemd-dev zlib1g-dev libpixman-1-dev libxcb-ewmh-dev wayland-protocols git
|
||||
|
||||
git clone https://github.com/Cloudef/wlc.git
|
||||
cd wlc
|
||||
git submodule update --init --recursive
|
||||
|
@ -24,86 +30,97 @@ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DSOURCE_WLPR
|
|||
make
|
||||
sudo make install
|
||||
````
|
||||
**TODO: Installing packages using make install is NOT the Debian way of doing things, and could break the system!**
|
||||
|
||||
Read here: https://wiki.debian.org/DontBreakDebian#Don.27t_.27make_install.27
|
||||
## Installing `experimental` dependencies
|
||||
|
||||
Instructions should either be updated to be installed to /usr/local prefix instead, or somehow make wlc library run locally along with the sway binary. Alternatively use `checkinstall`to debianize it.
|
||||
|
||||
Note: libxcb-emwh-dev is not included as a dependency in the install script, but I found that CMake refused to generate the necessary files without it. On Debian Jessie systems, substitute `libinput10` for `libinput5`.
|
||||
|
||||
Finally, we can install sway itself.
|
||||
|
||||
Note: If `apt-get install` tries to use lots of bandwidth and space, please try adding ` -o APT::Install-Recommends=0 -o APT::Install-Suggests=0` at the end of the command, to skip downloading optional dependencies.
|
||||
The remaining dependencies for `sway` - `libjson-c-dev` and `libwlroots-dev` - are only available in the appropriate versions from the `experimental` repositories. So, we will need to add this (or your preferred mirror) to `/etc/apt/sources.list`:
|
||||
|
||||
````
|
||||
sudo apt-get install meson libelogind-dev libpcre3 libpcre3-dev libcairo2 libcairo2-dev libpango1.0-0 libpango1.0-dev asciidoc libjson-c3 libjson-c-dev libcap-dev xsltproc libpam0g-dev
|
||||
deb http://ftp.debian.org/debian experimental main contrib non-free
|
||||
````
|
||||
|
||||
Then run `apt-get update` and Install these dependencies with:
|
||||
|
||||
````
|
||||
apt install -t experimental libjson-c-dev libwlroots-dev
|
||||
````
|
||||
|
||||
## Installing `sway`
|
||||
|
||||
Finally, we can install `sway` itself.
|
||||
|
||||
Note: If `apt-get install` tries to use more bandwidth and space than you have available, you can try adding ` -o APT::Install-Recommends=0 -o APT::Install-Suggests=0` at the end of the first command, to skip downloading optional dependencies.
|
||||
|
||||
````
|
||||
sudo apt-get install meson libelogind-dev libpcre3 libpcre3-dev libcairo2 libcairo2-dev libpango1.0-0 libpango1.0-dev asciidoc libjson-c3 libcap-dev xsltproc libpam0g-dev
|
||||
git clone https://github.com/SirCmpwn/sway.git
|
||||
cd sway/
|
||||
git checkout 1.0
|
||||
meson build # this will need libjson-c-dev >= 0.13 which is currently not in debian buster
|
||||
meson build
|
||||
ninja -C build
|
||||
sudo ninja -C build install
|
||||
````
|
||||
|
||||
Note: Installing libgdk-pixbuf2.0-0 and libgdk-pixbuf2.0-dev helped me get rid of a pixbuf2.0 required but not found error message on a fresh install of Debian 9.6.
|
||||
## Using `sway`
|
||||
|
||||
Now we can run 'sway' inside an active X session to try it out!
|
||||
|
||||
To prevent your desktop environment from starting up on boot you'll need to disable the Systemd target that starts it. [This article](https://www.digitalocean.com/community/tutorials/systemd-essentials-working-with-services-units-and-the-journal) is good reading material to learn more about the following commands.
|
||||
|
||||
First let's require some information about our system:
|
||||
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:
|
||||
````
|
||||
>> systemctl get-default
|
||||
graphical.target
|
||||
>> systemctl list-dependencies graphical.target
|
||||
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
|
||||
● ├─exim4.service
|
||||
● ├─gdm.service
|
||||
● ├─gdomap.service
|
||||
● ├─irqbalance.service
|
||||
● ├─minissdpd.service
|
||||
● ├─speech-dispatcher.service
|
||||
● ├─systemd-update-utmp-runlevel.service
|
||||
...
|
||||
● └─multi-user.target
|
||||
● ├─anacron.service
|
||||
● ├─atd.service
|
||||
● ├─avahi-daemon.service
|
||||
● ├─cron.service
|
||||
● ├─cups-browsed.service
|
||||
● ├─cups.path
|
||||
● ├─dbus.service
|
||||
● ├─exim4.service
|
||||
● ├─gdomap.service
|
||||
● ├─irqbalance.service
|
||||
● ├─minissdpd.service
|
||||
● ├─ModemManager.service
|
||||
● ├─networking.service
|
||||
● ├─NetworkManager.service
|
||||
● ├─pppd-dns.service
|
||||
● ├─rc-local.service
|
||||
● ├─rsyslog.service
|
||||
● ├─speech-dispatcher.service
|
||||
● ├─systemd-ask-password-wall.path
|
||||
● ├─systemd-logind.service
|
||||
● ├─systemd-update-utmp-runlevel.service
|
||||
● ├─systemd-user-sessions.service
|
||||
...
|
||||
● ├─basic.target
|
||||
● │ ├─-.mount
|
||||
● │ ├─alsa-restore.service
|
||||
● │ ├─alsa-state.service
|
||||
...
|
||||
````
|
||||
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.
|
||||
|
||||
The gdm.service is responsible of starting up your current desktop environment (try 'man gdm3'). Note the the multi-user.target is responsible for essential services like network management. The rest of the direct dependencies of graphical (the services between multi-user and graphical above) were not really useful to me and so I decided to configure multi-user.target as being the new default. By doing this, Gnome will not start up and instead you'll be presented with a terminal login on boot. After logging in you can run 'sway' to start up your new window manager!
|
||||
|
||||
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 `.bashrc` 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.
|
||||
|
||||
## Making sway functional
|
||||
|
||||
This section is not really Debian-specific except in so far as the presence in the repositories is noted. However these details should not be overlooked if you found your way directly to this guide without doing any other research.
|
||||
|
||||
**If you are new to `sway` and/or `i3`, be prepared for the fact that `sway` is largely unusable without some prior configuration and additional packages.** This is especially an issue if you installed using the minimal Debian Network Install image, in which case absolutely no graphical applications will be installed and you will have no way of doing anything without first changing to another tty, installing a terminal emulator of some kind and bind it to a key in your configuration file.
|
||||
|
||||
The configuration file for sway is read primarily from `$HOME/.config/sway/config`. A sample configuration file will have been installed in `/usr/local/etc/sway/config`. You should copy it and to the correct location in your home directory and edit it before launching `sway` for the first time.
|
||||
|
||||
Here is some additional software you might find useful:
|
||||
* urxvt - A popular lightweight terminal option which is used in the sample config (available in the repositories as `rxvt-unicode`)
|
||||
* [swaylock](https://github.com/swaywm/swaylock) - A simple session locker
|
||||
* [swayidle](https://github.com/swaywm/swayidle) - A customizable idle activity daemon
|
||||
* [waybar](https://github.com/Alexays/Waybar) - An enhanced taskbar (replaces `swaybar`).
|
||||
* [rofi](https://github.com/davatorium/rofi) - A flexible launcher and dmenu alternative (available in the repositories)
|
||||
* [dunst](https://github.com/dunst-project/dunst) - A lightweight and customizable notification daemon (available in the repositories)
|
||||
* [grim](https://github.com/emersion/grim) - A wayland compatible screenshot tool (available in the repositories)
|
||||
* [zathura](https://github.com/pwmt/zathura) - A lightweight and customizable, keyboard-driven PDF viewer (available in the repositories).
|
||||
|
||||
`sway` is extremely popular on [the unixporn subreddit](https://www.reddit.com/r/unixporn/search/?q=sway&restrict_sr=1). You may wish too have a look for other recommended applications and configurations there.
|
||||
|
||||
Feel free to add additional recommended applications to this list, noting that most users are interested in `sway` as a lightweight, keyboard-driven window manager. Heavy GUI applications like FireFox and LibreOffice are great options for all desktops, but are not specifically relevant to those goals.
|
Loading…
Reference in a new issue