way-cooler

From Gentoo Wiki
Jump to: navigation, search
This article is a stub. You can help by expanding it.
Article status
This article has some todo items:
  • Make the installation work
  • Complete the article
  • Wikify the article
  • Translate the article
This article needs wikification.

Resources
Warning
way-cooler is currently under heavy development!
Warning
The result of the installation steps will give you a binary, called way-cooler, which does not work on Gentoo somehow. These steps have to be reworked.

"Way Cooler is the spiritual successor of AwesomeWM for Wayland. It is a customizable Wayland compositor (window manager) which uses wlroots. Way Cooler is written in Rust and C."[1]

Prerequisites

Profile

Choose the appropriate desktop profile to set a number of global and package-specific USE flags:

root #eselect profile list
  [...]
  [16]  default/linux/amd64/17.0/desktop (stable)
  [17]  default/linux/amd64/17.0/desktop/gnome (stable)
  [18]  default/linux/amd64/17.0/desktop/gnome/systemd (stable)
  [19]  default/linux/amd64/17.0/desktop/plasma (stable)
  [20]  default/linux/amd64/17.0/desktop/plasma/systemd (stable)
  [...]
root #eselect profile set 16

The selection will be indicated by an asterisk (*):

root #eselect profile list
  [...]
  [16]  default/linux/amd64/17.0/desktop (stable) *
  [17]  default/linux/amd64/17.0/desktop/gnome (stable)
  [18]  default/linux/amd64/17.0/desktop/gnome/systemd (stable)
  [19]  default/linux/amd64/17.0/desktop/plasma (stable)
  [20]  default/linux/amd64/17.0/desktop/plasma/systemd (stable)
  [...]

Packages

  1. wayland: including the server and client libraries
  2. dbus: an interprocess communication (IPC) system for software applications
  3. wlc: a high-level Wayland compositor library (deprecated, use gui-libs/wlroots in the future instead)
  4. lua 5.3.x: a powerful, efficient, lightweight, embeddable scripting language
  5. rust/cargo: the package manager / build system used by rust
  6. cairo: a vector graphics library with cross-device output support
  7. gdk-pixbuf: a library for image loading and manipulation
  8. libxcb: a replacement for Xlib

Optional

  1. weston: the init file defaults to using weston-terminal as the default terminal emulator
  2. way-cooler-bg: a background client
  3. wc-grab: a screenshot client
  4. wc-lock: a lockscreen client

Installation

Currently there is neither an official Gentoo package nor an overlay package of way-cooler available. Therefore the "build from source" method will be used which is stated on the way-cooler's crates.io page.

Preparation

Install Wayland

First of all install Wayland which represents the base. Add the USE flags wayland and -X to /etc/portage/make.conf:

FILE /etc/portage/make.conf
USE="[...] wayland -X"

Make sure to recompile all installed packages:

root #emerge --ask --changed-use --deep @world

Then, mark wayland into the world file:

root #emerge --noreplace dev-libs/wayland

Install dbus

sys-apps/dbus is necessary to ensure the communication between programs and the desktop:

The dbus USE flag is automatically enabled when one of the desktop profiles is chosen as in the example above.

If this USE was previously disabled in /etc/portage/make.conf or /etc/portage/package.use, remove any such disabling entries. If a desktop profile was not chosen, add the dbus USE to make.conf.

Recompile all packages which might depend on sys-apps/dbus:

root #emerge --ask --changed-use --deep @world

Start the daemon:

root #/etc/init.d/dbus start

Make sure to always start dbus at the default runlevel:

root #rc-update add dbus default

Install wlc

Since there is no stable package of dev-libs/wlc available yet, add the following accepted keywords to /etc/portage/package.accept_keywords:

FILE /etc/portage/package.accept_keywords
=dev-libs/wlc-0.0.11

Install the Wayland Compositor Library dev-libs/wlc:

root #emerge --ask dev-libs/wlc

Install Lua

Add the following accepted keywords to /etc/portage/package.accept_keywords:

FILE /etc/portage/package.accept_keywords
dev-lang/lua:5.3
app-eselect/eselect-lua

Also add the following lines to unmask the package dev-lang/lua slot 5.3:

FILE /etc/portage/package.accept_keywords
app-eselect/eselect-lua
dev-lang/lua:5.3

Finally, install the package:

root #emerge --ask dev-lang/lua:5.3

Install Rust

In order to install way-cooler from source, the package dev-lang/rust must be installed with the USE flag cargo. Add the following USE flag to /etc/portage/package.use/rust:

FILE /etc/portage/package.use/rust
dev-lang/rust cargo

Now, Install the package:

root #emerge --ask dev-lang/rust

After that the command cargo should be available.

Install cairo

In order to display images, the package x11-libs/cairo must be installed:

root #emerge --ask x11-libs/cairo

Install way-cooler

By default, cargo will install Rust binaries in ~/.cargo. To specify an alternative installation directory, export the following environment variables:

root #export CARGO_HOME="/usr/local/src/rust/cargo"
root #export RUSTUP_HOME="/usr/local/src/rust/multirust"

Make them persistent by creating a file in /etc/profile.d/:

FILE /etc/profile.d/rust_install_path.sh
export CARGO_HOME="/usr/local/src/rust/cargo"
export RUSTUP_HOME="/usr/local/src/rust/multirust"

Create the corresponding directories and set owner and group permissions:

root #mkdir --parents /usr/local/src/rust/{cargo,multirust}
root #chown --recursive larry:larry /usr/local/src/rust

Finally compile and install way-cooler. This will download necessary packages to /usr/local/src/rust/cargo/:

user $cargo install way-cooler

Instead of adding the path /usr/local/src/rust/cargo/bin to the PATH environment variable, we will link the file way-cooler to /usr/local/bin/:

root #ln -sr /usr/local/src/rust/cargo/bin/way-cooler /usr/local/bin

Start way-cooler (does not work)

At this point way-cooler should be able to start, but it just outputs environment variables and then exits:

user $way-cooler

Troubleshooting

error: failed to run custom build command for `dbus v0.4.1`

CODE error: failed to run custom build command for `dbus v0.4.1`
process didn't exit successfully: `/tmp/cargo-install5VscCb/release/build/dbus-988c7d5f73621c46/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "`\"pkg-config\" \"--libs\" \"--cflags\" \"dbus-1\"` did not exit successfully: exit code: 1\n--- stderr\nPackage dbus-1 was not found in the pkg-config se
arch path.\nPerhaps you should add the directory containing `dbus-1.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'dbus-1\' found\n"', libcore/result.rs:945:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.

warning: build failed, waiting for other jobs to finish...
error: failed to compile `way-cooler v0.8.1`, intermediate artifacts can be found at `/tmp/cargo-install5VscCb`

Caused by:
  build failed

Solution

Install sys-apps/dbus properly; take a look at the installation instructions of D-Bus.

error: failed to run custom build command for `gdk-pixbuf-sys v0.4.0`

CODE error: failed to run custom build command for `gdk-pixbuf-sys v0.4.0`
process didn't exit successfully: `/tmp/cargo-install09iaye/release/build/gdk-pixbuf-sys-b18f670937a0cd5f/build-script-build` (exit code: 1)
--- stderr
`"pkg-config" "--libs" "--cflags" "gdk-pixbuf-2.0 >= 2.26"` did not exit successfully: exit code: 1
--- stderr
Package gdk-pixbuf-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gdk-pixbuf-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gdk-pixbuf-2.0' found


warning: build failed, waiting for other jobs to finish...
error: failed to compile `way-cooler v0.8.1`, intermediate artifacts can be found at `/tmp/cargo-install09iaye`

Solution

Install x11-libs/gdk-pixbuf properly:

root #emerge --ask x11-libs/gdk-pixbuf

Missing libraries

During the cargo compile, some libraries may be reported as missing:

cannot find -lxcb-xkb

Use the command equery files <package_name> to make sure that the C header files are available. For example (cannot find -lxcb-xkb):

user $equery files libxcb | grep "include"
/usr/include
/usr/include/xcb
/usr/include/xcb/bigreq.h
/usr/include/xcb/composite.h
/usr/include/xcb/damage.h
/usr/include/xcb/dpms.h
/usr/include/xcb/dri2.h
/usr/include/xcb/dri3.h
/usr/include/xcb/ge.h
/usr/include/xcb/glx.h
/usr/include/xcb/present.h
/usr/include/xcb/randr.h
/usr/include/xcb/record.h
/usr/include/xcb/render.h
/usr/include/xcb/res.h
/usr/include/xcb/screensaver.h
/usr/include/xcb/shape.h
/usr/include/xcb/shm.h
/usr/include/xcb/sync.h
/usr/include/xcb/xc_misc.h
/usr/include/xcb/xcb.h        <----
/usr/include/xcb/xcbext.h
/usr/include/xcb/xevie.h
/usr/include/xcb/xf86dri.h
/usr/include/xcb/xfixes.h
/usr/include/xcb/xinerama.h
/usr/include/xcb/xinput.h
/usr/include/xcb/xkb.h        <----
/usr/include/xcb/xprint.h
/usr/include/xcb/xproto.h
/usr/include/xcb/xselinux.h
/usr/include/xcb/xtest.h
/usr/include/xcb/xv.h
/usr/include/xcb/xvmc.h

Make sure that the USE flag xkb is set:

FILE /etc/portage/package.use/libxcb
x11-libs/libxcb xkb

Make sure the package is installed and compiled with the USE flag:

root #emerge --ask --changed-use --deep @world

cannot find -llua5.3

Install the package dev-lang/lua properly; see Install Lua.

cannot find -lwlc

Install the package dev-libs/wlc properly; see Install wlc.

warning: redundant linker flag specified for library `dbus-1`

Could be important when debugging...

Solution

There is no solution yet!

way-cooler does not start but just outputs environment variables

user $way-cooler
    Launching way-cooler...
     INFO [way_cooler] src/main.rs:215 Logger initialized, setting wlc handlers.
     INFO [way_cooler] src/main.rs:220 TERM: screen-256color
     ....
     INFO [way_cooler] src/main.rs:220 _: /usr/local/bin/way-cooler

Solution

There is no solution yet!

See also

External links