Skip to content
This repository has been archived by the owner on Sep 14, 2024. It is now read-only.

Trundle/awc

Repository files navigation

awc

Note

Awc is unmaintained. Give niri a try instead.

A Wayland compositor using wlroots written in Swift.

It is heavily inspired, conceptually as well as code-wise, from XMonad.

Configuration

Awc uses Dhall as language for its configuration. It automatically loads a configuration located under $XDG_CONFIG_DIRS/awc/config.dhall, typically ~/.config/awc/config.dhall, on startup.

Following is an empty config that uses all the defaults:

let Types = env:AWC_TYPES in Types.Config::{=}

That's probably a pretty boring configuration, as it doesn't define any keybindings and hence it's not possible to switch any windows or to do anything. You likely want to override the keybindings with some actions:

let mod = Types.Modifier.Logo
in Types::Config{
, keyBindings =
    [ { mods = [ mod ]
      , key = Types.Key.Sym "j"
      , action = Types.Action.FocusDown
      }
    , { mods = [ mod ]
      , key = Types.Key.Sym "k"
      , action = Types.Action.FocusUp
      }
    , { mods = [ mod, Types.Modifier.Shift ]
      , key = Types.Key.Sym "Return"
      , action = Types.Action.Execute "kitty"
      }
    ]
}

For a list of available actions, see Sources/awc_config/Dhall/Types.dhall.

A sample configuration can be found here.

Note that reloading the configuration when running Awc currently doesn't affect all settings (e.g. border width).

Supported layouts

In general, awc maintains an order of views per workspace. The views of one workspace are split into three different parts:

  • the views before the focused view (up)
  • the focused view
  • the views after the focused view (down)

Per convention, the first view is the main view. Some layouts (e.g. TwoPane) treat the main view specially, for example by always showing it.

Full

Uses all available space to show the focused view.

https://trundle.github.io/awc/full.png

Tiled

Splits the available space vertically by a configurable ratio. Shows the main view (first view in stack) on the left. All remaining views are tiled horizontally on the right.

https://trundle.github.io/awc/tiled.png

TwoPane

Splits the available space vertically by a configurable ratio. Shows the main view (first view in stack) on the left and the focused view on the right. If the main view is also the focused view, the next view down the stack is shown on the right.

https://trundle.github.io/awc/two_pane.png

Capped

Wraps another layout and limits the number of views to a configured amount.

Magnified

Wraps another layout and scales the focused view by a configured factor if it's not the main view.

https://trundle.github.io/awc/magnified_tiled_1.png

https://trundle.github.io/awc/magnified_tiled_2.png

Rotated

Rotates another layout by 90 degrees. For example, a rotated TwoPane splits the available space vertically instead of horizontally.

https://trundle.github.io/awc/rotated_two_pane.png

Reflected

Reflects another layout either horizontally or vertically. For example, a horizontally reflected TwoPane shows the main view on the right and the focused view on the left.

https://trundle.github.io/awc/reflected_two_pane.png

https://trundle.github.io/awc/reflected_rotated_two_pane.png

How can I set a background, have a status bar or lock the screen?

Awc builds upon wlroots, the same library that is used by Sway. It also implements a lot of wlroots protocols such as wlr-input-inhibitor. That means that quite a few tools work with Awc as well, such as grim, swaybg, swaylock or waybar.

How to build

Install the following dependencies and then run make.

Dependencies

  • Rust
  • Swift 5.3 (or newer)
  • GLESv2
  • libdrm
  • libinput
  • pixman
  • pkg-config
  • wayland
  • wayland-protocols
  • wlroots (>= 0.14.0)
  • xcb
  • xkbcommon
  • openssl

Alternatives

There is a variety of other Wayland compositors if you don't like Awc. Following are listed a few (without any claim to completeness):

GNOME and KDE also work well with Wayland. See also wlroot's project list.

License

Awc is released under the Apache License, Version 2.0. See LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html for details.

Design-wise, Awc is heavily inspired by XMonad (e.g. zippers, layouts), which is:

Copyright (c) 2007,2008 Spencer Janssen
Copyright (c) 2007,2008 Don Stewart

and released under a BSD license.