Skip to content

Commit d9ab92f

Browse files
committed
Updating README
1 parent 0856525 commit d9ab92f

File tree

1 file changed

+117
-141
lines changed

1 file changed

+117
-141
lines changed

README.md

+117-141
Original file line numberDiff line numberDiff line change
@@ -4,153 +4,129 @@ penrose - a tiling window manager library
44

55
[![Build](https://github.com/sminez/penrose/workflows/Build/badge.svg?branch=develop)](https://github.com/sminez/penrose/actions?query=workflow%3ABuild) [![crates.io version](https://img.shields.io/crates/v/penrose)](https://crates.io/crates/penrose)
66

7-
:warning: Multiple breaking API changes are being made in advance of the 0.2.0
8-
release. Please see commit history at the current time for details. :warning:
9-
10-
`penrose` is a modular library for configuring your own X11 window manager in
11-
Rust. It uses a workspace model as opposed to dwm or awesome style tags and
12-
provides a default backend for interacting with the X server written on top of
13-
the XCB API. The project is very much a work in progress as I try to set up my
14-
ideal, minimal window manager for daily use and in its current state you should
15-
be prepared to see breaking API changes as things stabilise. That said,
16-
`penrose` is now feature complete enough and stable enough to use as your
17-
primary Window Manager, so long as you don't mind a few rough edges! I am aiming
18-
for the code to be well documented and easy to extend. For now, this is my
19-
primary hobby project so updates are frequent: I try to keep crates.io up to
20-
date when new major features are completed but you can follow the `develop`
21-
branch in github for the latest changes. (Please note that `develop` is as it
22-
sounds and that stability is not guaranteed in any way.)
7+
`Penrose` is a modular library for configuring your own X11 window manager in Rust.
8+
9+
This means that, unlike most other tiling window managers, `Penrose` is not a
10+
binary that you install on your system. Instead, you use it like a normal
11+
dependency in your own crate for writing your own window manager. Don't worry,
12+
the top level API is well documented and a lot of things will work out of the
13+
box, and if you fancy digging deeper you'll find lots of opportunities to
14+
customise things to your liking.
2315

2416
![screenshot](https://raw.githubusercontent.com/sminez/penrose/develop/screenshot.png)
2517

26-
### Current project status
27-
28-
While the project is still in its early stages, please expect there to be
29-
multiple breaking changes as the public API stabilises. The example config files
30-
will always be kept up to date so please refer to them for updating to newer
31-
versions published to cargo. I try, where possible, to ensure that all
32-
functionality is showcased in at least one of the examples but you should take a
33-
look at the docs on docs.rs for the full public API if you want to check out all
34-
of the available functionality.
35-
36-
I am currently using penrose as [my daily driver](https://github.com/sminez/my-penrose-config)
37-
and actively working on the project: poking around in the guts of various
38-
existing window managers, seeing what I like and what I want to incorporate.
39-
Development may be a little sporadic depending on what my current work / home
40-
commitments are but you can typically expect to see updates every few days.
41-
I am trying to provide some demos and examples on
42-
[youtube](https://www.youtube.com/channel/UC04N-5DxEWH4ioK0bvZmF_Q) as I go,
43-
particularly when major new features are added.
44-
45-
### FAQ
46-
47-
#### How do I use penrose?
48-
49-
Please look at the examples provided in the `examples` directory.
50-
51-
#### Does penrose support Wayland as opposed to X11?
52-
53-
No. Wayland merges the window manager with the compositor which is significantly
54-
more work. Unless you want to do it yourself, Wayland support is "not a thing".
55-
56-
#### Can you add this piece of eye candy to penrose?
57-
58-
No. The core of `penrose` is a fast, minimalist window manager. Window
59-
decorations, animations and screenshot friendly window positioning are not
60-
useful to me in my day to day work and I will not be spending any of my free
61-
time implementing them. If you can find a way of implementing them that does not
62-
modify anything in the `src/core` directory then feel free to raise an issue
63-
outlining your implementation for inclusion in the `contrib` directory.
64-
65-
#### Are you accepting contributions?
66-
67-
If there is a feature that you would like to contribute as an extension to
68-
`penrose` for the `contrib` directory then please raise an issue explaining the
69-
use case, detailing your intended implementation. At the moment I do not have a
70-
concrete set of guidlines for contributers given the small nature of the project
71-
but I do work have a lot of preferences around how I want penrose to work. If
72-
you are wanting to pick up and work on one of the issues currently open please
73-
start a discussion about it on the issue itself before raising a PR: I am
74-
actively working on multiple aspects of the project at once and you may find
75-
things moving underneath you!
76-
77-
#### Will you add feature X from $OTHER_WM?
78-
79-
In all honesty, probably not. At this stage, `penrose` covers everything that I
80-
want / need from my window manager. I am more that happy to accept contributions
81-
for the `contrib` directory that extend the existing functionality but a key
82-
aspect of this project is that I want to understand the code that I am running
83-
on my machine. If the feature in question can not be implemented as an
84-
extension, feel free to raise an issue explaining your use case and why you feel
85-
it is needed but be prepared to write the implementation yourself.
86-
87-
### Getting started
88-
89-
Depending on how much tinkering you want to do, there are several example
90-
`main.rs` files in the `examples` directory that you can use as a starting point
91-
for your configuration. You will need to ensure that you at least have a
92-
terminal and program launcher set up (the defaults are `dmenu` and `st` from
93-
https://suckless.org) otherwise you are going to be unable to spawn programs!
94-
95-
As mentioned above, my personal set up is also hosted on github and runs from
96-
the head of develop as opposed to pinning at a specific released version. This
97-
is not recommended in general as develop is not guaranteed to be stable in any
98-
way (there are also likely to be intermittent breaking API changes as I iterate
99-
on the best way to do things). The aim is to provide an Xmonad style "extend
100-
with your own custom code" experience though obviously at present, penrose has
101-
no where near the same number of out of the box libraries and examples to work
102-
from so you will likely need to port over your favourite Xmonad / other WM
103-
features if you find them missing. If you are happy to do so, please do raise a
104-
PR and I can incorporate your favourite feature into the `contrib` directory.
105-
106-
If you update to a new version from crates.io (or are tracking develop) and you
107-
suddenly get compile errors in your config, please check the documentaton hosted
108-
on [docs.rs](https://docs.rs/penrose) to see if there have been any recent API
109-
changes. I am trying to keep breaking changes to a minimum but at this early
110-
stage in the project there are multiple things in flux as the codebase
111-
stabilises.
112-
113-
### Current functionality
114-
My personal set up has floated between a variety of tiling window managers over
115-
the years, ranging from i3, dwm and Qtile to Xmonad, Wmii and BSPWM. `penrose`
116-
is my attempt to cherry pick the functionality I make use of while also
117-
providing a flexible base to build from should you want to get your hands dirty
118-
with some rust yourself. As a non-exhaustive high-level overview of what is
119-
currently implemented you can take a look at the list below. Alternatively, have
120-
a look through the documentation (particularly the public methods on
121-
`WindowManager`) to see what is available.
122-
123-
#### Implemented
124-
- multi-monitor support
125-
- dynamic layouts
126-
- user defined hooks in response to `WindowManager` / `X` events
127-
- partial EWMH support (active window/desktop, number of desktops, desktop names, window manager name, desktop for client)
128-
- built in layout functions
129-
- user definable layout functions
130-
- hook based status bars
131-
- scratchpads
132-
- dynamic workspace creation
133-
- custom key bindings (able to trigger arbitrary rust code)
18+
<br>
19+
20+
### Getting Started
21+
22+
If you are new to Rust it is worthwhile reading the penrose [getting started][1]
23+
guide for details on how to get Rust set up on your system and how to get a
24+
minimal config in place. Once you've managed that, you might want to take a
25+
look at some of the configurations in the [examples][2] directory or my
26+
[personal config][3] which has several custom extensions.
27+
28+
After that, it's a good idea to read the documentation on [docs.rs][4] or the
29+
tutorial and overview videos on [youtube][5].
30+
31+
<br>
32+
33+
### Project Goals
34+
35+
#### Understandable code
36+
37+
`Penrose` was born out of my failed attempts to refactor the [dwm][6] codebase into
38+
something that I could more easily understand and hack on. While I very much
39+
admire and aim for minimalism in code, it becomes a problem when your complex
40+
code base starts playing code golf to keep things under an arbitrary line limit.
41+
42+
I won't claim that `Penrose` has the cleanest code base you've ever seen, but it
43+
_should_ be readible in addition to being fast. If something is confusing or
44+
unclear, then I count that as a bug (and please raise it as such!)
45+
46+
47+
#### Simple to configure
48+
49+
I've also tried my hand at [Xmonad][7] in the past. I love the set-ups people can
50+
achive with it ([this one][8] is a personal favourite) but doing everything in
51+
Haskell was a deal breaker for me. I'm sure many people will say the same thing
52+
about Rust but then at least I'm giving you some more options!
53+
54+
With `Penrose`, a simple config can be written in about 5 minutes and roghly 50
55+
lines of code. It will be pretty minimal but each additional feature (such as a
56+
status bar, scratchpads, custom layouts, dynamic menus...) can be added in as
57+
little as a single line. If the functionality you want isn't available however
58+
then that leads us on to...
13459

13560

61+
#### Easy to extend
62+
63+
[dwm][6] patches, [qtile][9] lazy APIs, [i3][10] IPC configuration; all of these
64+
definitely work but they are not what I'm after. Again, the [Xmonad][7] model of
65+
companion libraries that you bring in and use as part of writing your own window
66+
manager has always felt like the right model for me for extending the window
67+
manager. (Though, again, while Haskell is great fun for tinkering I've never
68+
felt productive in it)
69+
70+
`Penrose` provides a set of Rust traits for defining the various ways you can
71+
interact with the main `WindowManager` struct. You are free to write your own
72+
implementations, write code that manipulates them and extend them however you
73+
see fit. If you want to check out some examples of what is possible, take a look
74+
in the [contrib][11] directory.
75+
76+
Want to run some particular logic every time you connect external monitors?
77+
Write a [hook][12] that listens for randr triggers.
78+
79+
Want to scatter your windows at random over the screen? Write a custom
80+
[layout][13] and make use of all of the helper methods on [regions][14].
81+
82+
Have an idea that you can't currently implement? Raise an issue and suggest an
83+
extension to the API!
84+
85+
<br>
86+
13687
### Project Non-goals
137-
#### A config file
88+
89+
#### An external config file
90+
13891
Parsing a config file and dynamically switching behaviour on the contents adds a
139-
huge amount of complexity to the code. `penrose` is written as a library
140-
("crate" in the rust lingo) that you use to build your window manager as you see
141-
fit. There is a default set of behaviours that are mostly an opinionated hybrid of
142-
[dwm](https://dwm.suckless.org/) and [i3](https://i3wm.org/) but you are free to
143-
swap out pretty much everything should you wish.
144-
For example, if you prefer `dwm` style tags to workspaces, you should be able to
145-
get that up and running using the hooks system.
92+
huge amount of complexity to the code: not to mention the need for _validating_
93+
the config file! By default, `Penrose` is configured statically in your
94+
**main.rs** and compiled each time you want to make changes (similar to
95+
[Xmonad][7] and [dwm][6]).
96+
97+
That said, the extensibility of `Penrose` means that
98+
you are free to define your own config file format and parse that as part of
99+
your startup, if that is something you want. You could read from `xresources`,
100+
or a stand alone file of your design.
101+
102+
The choice is yours!
103+
146104

147105
#### IPC / relying on external programs
148-
I love acme from plan9 and how easy it is to drive it's state from external
149-
programs (check out my [acme-corp](https://github.com/sminez/acme-corp) tools to
150-
see what I mean) but that comes at the expense of the internal logic becoming
151-
_massively_ more complicated. As few moving parts as possible is ideal. So,
152-
things that are easy to acomplish using the XCB api (key bindings, simple
153-
rendering of a bar etc) are in, full on IPC via an exposed API is out.
154-
That's not to say that making use of external programs is out all together: just
155-
that window manager functionaly is internally implemented rather than relying on
156-
external processes for things like key bindings and window placement.
106+
107+
There are several places where `Penrose` makes use of external programs for
108+
utility functionality (reading the user's keymap or spawning a program launcher
109+
for example), but core window manager functionality is always going to stay
110+
internal.
111+
112+
As you might expect, you can definitely write your own extensions that provide
113+
some sort of IPC or client/server style mechanism if you want to mirror the
114+
kinds of things possible in other window managers such as `i3` or `bspwm`, but
115+
that is not going to be included at the expense of statically defined control in
116+
your binary as a default.
117+
118+
119+
[1]: https://sminez.github.io/projects/penrose/getting-started/
120+
[2]: https://github.com/sminez/penrose/tree/develop/examples
121+
[3]: https://github.com/sminez/my-penrose-config
122+
[4]: https://docs.rs/penrose
123+
[5]: https://www.youtube.com/channel/UC04N-5DxEWH4ioK0bvZmF_Q
124+
[6]: https://dwm.suckless.org/
125+
[7]: https://xmonad.org/
126+
[8]: https://www.youtube.com/watch?v=70IxjLEmomg
127+
[9]: http://www.qtile.org/
128+
[10]: https://i3wm.org/
129+
[11]: https://github.com/sminez/penrose/tree/develop/src/contrib
130+
[12]: https://docs.rs/penrose/0.2.0/penrose/core/hooks/index.html
131+
[13]: https://docs.rs/penrose/0.2.0/penrose/core/layout/index.html
132+
[14]: https://docs.rs/penrose/0.2.0/penrose/core/data_types/struct.Region.html

0 commit comments

Comments
 (0)