Skip to content

Commit

Permalink
Update README and add GitHub build workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
jichu4n committed Jul 3, 2024
1 parent ed84b71 commit 54f480c
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 27 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: build
on: [push, pull_request]
jobs:
build-deb:
strategy:
matrix:
container: ['ubuntu:jammy', 'ubuntu:noble', 'debian:bookworm']
runs-on: ubuntu-latest
container: ${{ matrix.container }}
steps:
- uses: actions/checkout@v4
- run: apt-get update
- run: apt-get install -y build-essential pkg-config libx11-dev libgoogle-glog-dev
- run: make
build-rpm:
strategy:
matrix:
container: ['fedora:latest']
runs-on: ubuntu-latest
container: ${{ matrix.container }}
steps:
- uses: actions/checkout@v4
- run: yum install -y make gcc gcc-c++ libX11-devel glog-devel
- run: make
build-arch:
strategy:
matrix:
container: ['archlinux:base']
runs-on: ubuntu-latest
container: ${{ matrix.container }}
steps:
- uses: actions/checkout@v4
- run: pacman -Sy --noconfirm base-devel libx11 google-glog
- run: make
48 changes: 21 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,46 @@
Basic Window Manager
====================
# Basic Window Manager

basic_wm is a simple reparenting, non-compositing X window manager that demonstrates
how to implement the fundamental functionality of a window manager:

* Managing the life cycle of windows
* Reparenting windows
* Basic window operations (moving, resizing, closing)
- Managing the life cycle of windows
- Reparenting windows
- Basic window operations (moving, resizing, closing)

It serves as a pedagogical example for my series of articles,
[_How X Window Managers Work, And How To Write One_](https://jichu4n.com/posts/how-x-window-managers-work-and-how-to-write-one-part-i/).


Building and Running
--------------------
## Building and Running

To build this example window manager, you will need:

* A C++-11 enabled C++ compiler
* [GNU Make](https://www.gnu.org/software/make/)
* Xlib headers and libraries
* [google-glog](https://code.google.com/p/google-glog/) library
- A C++-11 enabled C++ compiler
- [GNU Make](https://www.gnu.org/software/make/)
- Xlib headers and libraries
- [google-glog](https://code.google.com/p/google-glog/) library

To run and test it, you will need:

* [Xephyr](http://www.freedesktop.org/wiki/Software/Xephyr/)
* `xinit`
* Random X utilities such as `xclock`, `xeyes`, and `xterm` to play with
- [Xephyr](http://www.freedesktop.org/wiki/Software/Xephyr/)
- `xinit`
- Random X utilities such as `xclock`, `xeyes`, and `xterm` to play with

On [Ubuntu](https://www.ubuntu.com)/[Debian](https://www.debian.org/), you can
On [Ubuntu](https://www.ubuntu.com) / [Debian](https://www.debian.org/), you can
install these dependencies with:

sudo apt-get install \
build-essential libx11-dev libgoogle-glog-dev \
build-essential pkg-config libx11-dev libgoogle-glog-dev \
xserver-xephyr xinit x11-apps xterm

On [Fedora](https://getfedora.org)/[CentOS](https://www.centos.org), you can install these with:
On [Fedora](https://getfedora.org), you can install these with:

sudo yum install \
make gcc gcc-c++ libX11-devel glog-devel \
xorg-x11-server-Xephyr xorg-x11-apps xterm

On [Arch Linux](http://www.archlinux.org), you can install these with:

yaourt -S base-devel libx11 google-glog \
sudo pacman -S base-devel libx11 google-glog \
xorg-server-xephyr xorg-xinit xorg-xclock xorg-xeyes xterm

Consult your own distro's documentation for how to install these.
Expand All @@ -55,14 +52,11 @@ Once you have all the dependencies, building and running it is as simple as:
This will launch a simple Xephyr session like in the following screenshot:
![Screenshot](basic_wm_screenshot.png)


Usage
-----
## Usage

Supported keyboard shortcuts:

* **Alt + Left Click**: Move window
* **Alt + Right Click**: Resize window
* **Alt + F4**: Close window
* **Alt + Tab**: Switch window

- **Alt + Left Click**: Move window
- **Alt + Right Click**: Resize window
- **Alt + F4**: Close window
- **Alt + Tab**: Switch window

0 comments on commit 54f480c

Please sign in to comment.