~cben via newm-atha-devel
come talk to us on discord!
video couteresy of Audrick Yeu, used with permission.
Unfortunately, the orignal author of newm, jbuchermn no longer has the time to maintain this project.
I have been contributing to this project( @Pandademic on github, if you need proof), and have decided to fork it here for the sake of keeping it alive and maintained.
This IS a fork, and is reflected as such in ./LICENSE
newm-atha is a Wayland compositor written with laptops and touchpads in mind. The idea is, instead of placing windows inside the small viewport (that is, the monitor) to arrange them along an arbitrarily large two-dimensional wall (generally without windows overlapping) and focus the compositors job on moving around along this wall efficiently and providing ways to the user to rearrange the wall such that they find the overall layout intuitive.
So, windows are placed on a two-dimensional grid of tiles taking either one by one, one by two, two by one, ... tiles of that grid. The compositor shows a one by one, two by two, ... view of that grid but scales the windows so they are usable on any zoom level (that is, zooming out the compositor actually changes the windows sizes). This makes for example switching between a couple of fullscreen applications very easy - place them in adjacent one by one tiles and have the compositor show a one by one view. And if you need to see them in parallel, zoom out. Then back in, and so on...
The basic commands therefore are navigation (left, right, top, bottom) and zoom-in and -out. These commands can be handled very intuitively on the touchpad (one- and two-finger gestures are reserved for interacting with the apps):
To be able to arrange the windows in a useful manner, use
Logo
(default , unless configured otherwise) + one finger on the touchpad to move windowsLogo
(default , unless configured otherwise) + two fingers on the touchpad to change the extent of a windowTo get a quick overview of all windows, just hit the Logo
(default , unless configured otherwise) key.
Additionally with a quick 5-finger swipe a launcher panel can be opened.
These behaviours can (partly) be configured (see below for setup). By default (check default_config.py), the following key bindings (among others) are in place
Logo-hjkl
: Move aroundLogo-un
: ScaleLogo-HJKL
: Move windows aroundLogo-Ctrl-hjkl
: Resize windowsLogo-f
: Toggle a fullscreen view of the focused window (possibly resizing it)the current master branch is/was jbuchermn's 0.3 release, as a wip.
In honor of his efforts, the next release will be 0.4, built of from here.
Goals include:
There is a AUR package, newm-atha-git
.
This however is not maintained by me, but instead by Diego Aguilar.
flakes are probably the easiest way to do this.
nix build "sourcehut:~atha/newm-atha#newm-atha"
./result/bin/start-newm -d
Note that this probably does not work outside nixOS. To fix OpenGL issues on other linux distros using nix as a (secondary) package manager, see nixGL.
PAM authentication appears to be broken in this setup.
pywm-atha is the main dependency of newm-atha. If all prerequisites are installed, the command:
pip3 install --user git+https://git.sr.ht/~atha/pywm-atha
should suffice.Additionally, unless configured otherwise, newm-atha uses alacritty as its default terminal.
To install newm:
pip3 install --user git+https://git.sr.ht/~atha/newm-atha
Installing newm this way means it cannot be used as a login manager, as it can only be started by your current user (see below)
Start newm using
start-newm -d
it will log to $HOME/.cache/newm/newm_log
, if this file exists, it will move it to $HOME/.cache/newm/newm_log.old.$year-$month-$day-$epoch
(the timestamps of its last edit)
you can use the -d
flag for a more verbose, debug-y output.
you can use the -c
flag to point it toward a config file.
Configuring is handled via Python and read from either $HOME/.config/newm/config.py
or (lower precedence) /etc/newm/config.py
. Take default_config.py
as a basis; details on the possible keys are provided below.
For example, copy (path of default_config.py
in the example assumes pip installation)
cd
mkdir -p .config/newm
cp .local/lib/pythonX.Y/site-packages/newm/default_config.py .config/newm/config.py
vim .config/newm/config.py
and adjust, e.g. for a German HiDPI MacBook with a wallpaper placed in the home folder,
import os
from pywm import (
PYWM_MOD_LOGO,
PYWM_MOD_ALT
)
def on_startup():
os.system("waybar &")
def on_reconfigure():
os.system("notify-send newm \"Reloaded configuration\" &")
bar = {
'enabled': False,
}
background = {
'path': os.environ['HOME'] + '/wallpaper.jpg'
}
outputs = [
{ 'name': 'eDP-1', 'scale': 2. }
]
pywm = {
'xkb_model': "macintosh",
'xkb_layout': "de,de",
'xkb_options': "caps:escape",
}
The configuration works by evaluating the python config file and extracting the variables which the file exports. So basically you can do whatever you please to provide the configuration values,
hence why certain config elements are callbacks. Some elements are hierarchical, to set these use Python dicts - e.g. for x.y
:
x = {
'y': 2.0
}
The configuration can be dynamically updated (apart from a couple of fixed keys) using Layout.update_config
(by default bound to Mod+C
).
See config for a documentation on all configurable values.
BEWARE that functions (as in keybindings, on_startup
, ...) are run synchronously in the compositor thread.
It is very much encouraged to use evdev, instead of python gestures (see config), however these might not work right from the start. Try:
ls -al /dev/input/event*
evtest
This is a required prerequisite to use the python-side (smoother) gestures. C-side or DBus gestures do not require this.
As a side note, this is not necessary for a Wayland compositor in general as the devices can be accessed through systemd-logind
or seatd
or similar.
However the python evdev
module does not allow instantiation given a file descriptor (only a path which it then opens itself),
so usage of that module would no longer be possible in this case (plus at first sight there is no easy way of getting that file descriptor to the
Python side). Also wlroots
(libinput
in the backend) does not expose touchpads as what they are (touch-down
, touch-up
, touch-motion
for any
number of parallel slots), but only as pointers (motion
/ axis
), so gesture detection around libinput
-events is not possible as well.
Therefore, we're stuck with the less secure (and a lot easier) way of using the group (probably) named input
.
newm-cmd
provides a way to interact with a running newm instance from command line:
newm-cmd inhibit-idle
prevents newm from going into idle states (dimming the screen)newm-cmd config
reloads the configurationnewm-cmd lock
locks the screennewm-cmd open-virtual-output <name>
opens a new virtual output (see newm-sidecar)newm-cmd close-virtual-output <name>
close a virtual outputnewm-cmd clean
removes orphaned states, which can happen, but shouldn't (if you encounter the need for this, please file a bug)newm-cmd debug
prints out some debug info on the current state of viewsnewm-cmd unlock
unlocks the compositor (if explicitly enabled in config) - this is useful in case you have trouble setting up the lock screen.Make sure to install newm-atha as well as pywm-atha and a newm panel in a way in which the greeter
user has access.
Place newm-atha configuration in /etc/newm/config.py
and check, after logging in as greeter
, that start-newm
works and shows the login panel (login itself should not work). If it works, set
command = "start-newm"
in /etc/greetd/config.toml
.
Thank you to: