diff --git a/README.md b/README.md new file mode 100644 index 0000000..23f3c4c --- /dev/null +++ b/README.md @@ -0,0 +1,122 @@ +# awm – Alacritty Window Manager +A simple WM to manage your Alacritty terminal windows. + +## What is AWM? +Alacritty Window Manager (AWM) is a Window Manager (WM) akin to software like DWM +which is responsible for tiling windows open on the desktop into appropriate +layout configurations. It differs from conventional window tiling acheived by +dragging window tabs into different regions of a desktop environment, simply +because WMs are used in non-DEs whereby this mechanic does not exist. Windows +which also lack decoration frames to allow them to be moved via dragging benefit +from WMs correctly arranging them. + +Now, AWM does not take any inspiration from DWM, more than what DWM takes from +general WMs. AWM works with the Win32 API, whereas DWM works with X11, so +everything within the APIs will be completely different. DWM is also a general WM +for tiling all windows on a system, and AWM works only for Alacritty terminals. + +## Why Does AWM Exist? +Why do WMs exist in general? They're sleek-looking, organise windows in an easy +fashion, do better jobs than DEs, amongst many more reason. The main reason is +that if a window GUI is created without a frame, there's no easy way to then +move that window, let alone to a specific location on a screen. + +AWM achieves all of this. It allows for no decoration on Alacritty windows, whilst +being able to organise up to four windows Alacritty creates for terminal sessions. +And this is all for Windows to make life much easier for users, whilst still +looking like novice ricers. + +## How Does AWM Work? +Well, AWM is heavily documented in the code base, which consists of a single C++ +file. But the short version is as followed: + +- When `awm` is executed, it will go and find all windows associated with +Alacritty (up to 4 at most). +- Once it has found the windows, it organise them based on a set of predefined +configurations depending on the number of windows found. +- This occurs simultaneously to give a smooth organisation transition for any +number of Alacritty terminal windows. + +It's that simple. No additional event listeners/hooks, no spawning new processes. + +For a more in-depth, and technically explanation where applicable, consult the +`main.cpp` found in the root directory of the project's workspace. + +## How to Install AWM +Currently, the only way to install AWM is by manually compiling the binary and +placing it somewhere in your local user-space and adding that to your path. You +may wish to keep the compiled binary in the repo and have your path point to that +location. + +Compiling can be performed with any compiler. There's no linking of other libries +or C++ source files, assuming that the appropriate header files are installed to +the system, it should just compile. + +However, the only compiler that has been used for AWM is the `g++` compiler by +GNU. If you have this compiler installed, the following command will compile the +binary on your system (CWD set to the awm repo): + +```cmd +mkdir bin +g++ -O3 -std=c++11 main.cpp -o bin\awm.exe +``` + +_Compilation should compile without any errors, and any such which are reported +might be due to missing header files. Please consult the `main.cpp` file for the +relavent header files and/or libraries._ + +Afterwards, you can add the `bin` directory to your local Path (or system-wide +with appropriate pivilage levels). Something as followed in PowerShell will allow +AWM to be ran anywhere on the system: + +```ps +$env:Path += ';\path\to\awm\bin' +``` + +## How to Use AWM +AWM can simply be called directly as a program, and will attempt to organise any +Alacritty windows it identifies. However, a more useful usage would be via +Alacritty keybindings. This can be simply achieved in the `alacritty.yml` +configuration file using the `command` action. + +The following is an example keybinding configuration which can be used in +Alacritty (with respect to potential conflicts with other bindings). Open the +YAML file in an editor (typically located at `%APPDATA%\alacritty\alacritty.yml`) +and add the following line: + +```yaml +key_bindings: + - { key: O, mods: Control|Shift, command: { program: "awm", args: [] } } +``` + +This will then call AWM wherever its located on the system via Path and organise +Alacritty windows accordingly. + +**Note:** AWM does not listen for when Alacritty windows are created or destroyed. +It simply organises windows it's able to collect in a tiled manner when told to. + +## Known Issues & Limitations +As discussed in the note above, and elsewhere, AWM **does not** add event hooks +to the system, or listen to any event hooks that might trigger when an Alacritty +window is created or destroyed. For this reason, AWM must be manually told when +to organise windows on the desktop. If this feature is to be required, a separate +executable should be created to handle these hook events and compile AWM into its +binary to then call the existing WM source code. + +Another known issue is with Task Manager and not compiling with at least `-O3`. +Put simply, if the binary is compiled without this optimisation flag, and Task +Manager is open, AWM will fail to organise the windows due to Task Manager. It's +currently unknown why this bug exists without `-O3`, and doesn't with the flag, +but it can be easily avoided with the `-O3` flag using `g++`. A future patch may +be applied to this in the future. + +## Licence +This project is licenced until the GNU GPLv3+ licence agreement, which can be +viewed in the `LICENCE.txt` file in the root directory of the repository. + +## Author +Ethan Smith-Coss (ethan.sc@closedless.xyz) + +## Bug Tracker +To report a bug, or feature of the program, an Issue can be created with the +relavent information.