Home

Awesome

pywm - backend for newm

Unfortunately, newm as well as pywm are currently unmaintained.

pywm is an abstraction layer for newm encapsulating all c code.

Basically this is a very tiny compositor built on top of wlroots, making all the assumptions that wlroots does not. On the Python side pywm exposes Wayland clients (XDG and XWayland) as so-called views and passes along all input. This way, handling the positioning of views, animating their movement, ... based on keystrokes or touchpad inputs (i.e. the logical, not performance-critical part of any compositor) is possible Python-side, whereas rendering and all other performance-critical aspects are handled by c code.

Check the Python class PyWM and c struct wm_server for a start, as well as newms Layout.

See also pywm-fullscreen for a trivial implementation opening one application in fullscreen.

Attention

v0.3 with a better renderer implementation supporting blur has been merged into master. There are still some bugs around but I consider it an alpha stage.

Installing

If you install newm via the AUR, pywm is installed automatically.

Prerequisites

Prerequisites for PyWM, apart from Python, are given by wlroots:

Install

Compilation is handled by meson and started automatically via pip (you need to install prerequisites first):

pip3 install git+https://github.com/jbuchermn/pywm

In case of issues, clone the repo and execute meson build && ninja -C build in order to debug.

Configuration

Configuration is handled via key-value pairs given to the PyWM contructor:

KeyDefaultDescription
enable_xwaylandFalseBoolean: Start XWayland
xkb_modelString: Keyboard model (xkb)
xkb_layoutString: Keyboard layout (xkb)
xkb_variantString: Keyboard variant (xkb)
xkb_optionsString: Keyboard options (xkb)
outputsList of dicts: Output configuration (see next lines)
output.name""String: Name of output to attach config to actual output
output.scale1.0Number: HiDPI scale of output
output.width0Integer: Output width (or zero to use preferred)
output.height0Integer: Output height (or zero to use preferred)
output.mHz0Integer: Output refresh rate in milli Hertz (or zero to use preferred)
output.pos_xNoneInteger: Output position x in layout (or None to be placed automatically)
output.pos_yNoneInteger: Output position y in layout (or None to be placed automatically)
xcursor_themeString: XCursor theme (if not set, read from; if set, exported to XCURSOR_THEME)
xcursor_size24Integer: XCursor size (if not set, read from; if set, exported to XCURSOR_SIZE)
tap_to_clickTrueBoolean: On tocuhpads use tap for click enter
natural_scrollTrueBoolean: On touchpads use natural scrolling enter
focus_follows_mouseTrueBoolean: Focus window upon mouse enter
contstrain_popups_to_toplevelFalseBoolean: Try to keep popups contrained within their window
encourage_csdTrueBoolean: Encourage clients to show client-side-decorations (see wlr_server_decoration_manager)
debugFalseBoolean: Loglevel debug plus output debug information to stdout on every F1 press
texture_shadersbasicString: Shaders to use for texture rendering (see src/wm/shaders/texture)
renderer_modepywmString: Renderer mode, pywm (enable pywm renderer, and therefore blur), wlr (disable pywm renderer)

Troubleshooting

seatd

Be aware that current wlroots requires seatd under certain circumstances. Example systemd service (be sure to place your user in group _seatd):

[Unit]
Description=Seat management daemon
Documentation=man:seatd(1)

[Service]
Type=simple
ExecStart=seatd -g _seatd
Restart=always
RestartSec=1

[Install]
WantedBy=multi-user.target