diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..5a7ed93 --- /dev/null +++ b/.github/workflows/build.yaml @@ -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 diff --git a/README.md b/README.md index 2645cf9..23069b0 100644 --- a/README.md +++ b/README.md @@ -1,41 +1,38 @@ -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 \ @@ -43,7 +40,7 @@ On [Fedora](https://getfedora.org)/[CentOS](https://www.centos.org), you can ins 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. @@ -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