Skip to content

[WIP] YATwm (Yet Another Tiling window manager) is as the name implies. Could also be called YAT (Yet Another Tiler) if you can't be bothered with the wm

License

Notifications You must be signed in to change notification settings

BossCode45/YATwm

Repository files navigation

YATwm

This readme is best read in Emacs!

Disclaimer: This is still very much in beta

This only just works, multiple monitors aren’t supported and floating windows cannot move and there is no resizing. Many features are just hacked together and are likely to break. However, it is just about usable so if you really want to try then go for it! (feel free to make an issue if you have any questions).

Usage instructions

Installation

Pre reqs

  • Xlib and g++ and libnotify to build the program
  • Xephyr for the test script
  • rofi, alacritty, and i3lock for the default config
    • The current default config is currently just the configuration that I want to use (this will likely change)

Installing and removing

  • make i or make install to install
  • make r or make remove to remove
  • ./test to test

Config

You can configure YATwm with the config file in $HOME/.config/YATwm/config or $XDG_CONFIG_HOME/YATwm/config if you have that set. I have provided an example config file in the project dir that has all the variables set to their defaults (this will also be installed to /etc/YATwm/config. It should alert you with a notification if you have an error, and put the error your log file. If the whole file is missing then it will use the default in /etc/YATwm/config.

Syntax

The config file is a list of commands. Each command should be on a new line. For example, to set the gaps you would use the gaps command like this gaps 10 (make sure this is all there is on that line). This says to call the command gaps with the arguments of 10. Commands can have multiple arguments and these should be separated with a space, if you want a space in one of the arguments then wrap the arg in quotes, e.g. addWorkspace "1: A" 1, here the arguments are 1: A and 1. If you want to have a quote in your argument then make sure that arg is wrapped in quotes or escape it with \ (e.g. \'), to insert \ then use \\. If you want to have multiple commands on the same line, e.g. binding a key to multiple commands, then use ; as an argument on its own to separate them (tip: if you are using this for keybinds then enclose all the keybind commands in quotes, e.g. bind mod+l "spawn i3lock ; spawn systemctl suspend").

Command arg types

  • String: this is just some text, this can be wrapped in quotes if you want a space in it.
  • String rest: This will only ever be the final argument. This just takes the rest of the line as a string, so you can use spaces without needing quotes.
  • Number: This is a number, with the digits 0-9.
  • Number array rest: This will only ever be the final argument. This takes the rest of the line as a list of number, separated with spaces, e.g. 2 1 3.
  • Direction: This is one of the cardinal directions listed below.
    • left
    • right
    • up
    • down

List of commands

  • exit: shuts down YATwm
  • spawn: Spawns an application using execvp
    • String rest: what to spawn, first word is the command, and following words are arguments
  • spawnOnce: Same as spawn but only runs on the first load of the config file
    • String rest: what to spawn, first word is the command, and following words are arguments
  • toggle: Changes the tiling direction for the next window
  • kill: Kills the focused window
  • changeWS: changes to a different workspace
    • Number: Which workspace to change to, starts at 1 for first workspace.
  • wToWS: moves a window to a workspace
    • Number: Which workspace to move the window to, starts at 1 for first workspace.
  • focChange: Changes the focus in a direction
    • Direction: Which direction to focus in
  • bashSpawn: Spawns something uses system (your shell)
    • String rest: A string which gets sent to bash
  • bashSpawnOnce: Same as bashSpawn but only runs on the first load of the config file
    • String rest: A string which gets sent to bash
  • reload: Reloads YATwm, this reloads the config file and re runs the monitor detection, and will unmap and remap all windows to refresh them.
  • nextMonitor: Focuses the next monitor, wraps around.
  • fullscreen: Toggles if the current window is fullscreen
  • gaps: Sets the size of the inner gaps, margins around each window (this ends up looking doubled as each window has it)
    • Number: The size in pixels
  • outergaps: Sets the size of the outer gaps, distance for windows and the edge of the output (add this to the inner gaps to get distance between window and edge of output)
    • Number: The size in pixels
  • logfile: The file to write the log to
    • String: The name of the file
  • swapmods: Swaps super and alt for keybinds
  • addworkspace: Adds a workspace (note: This doesn’t work very well with refreshes, I’d suggest not messing with it, but you can probably change the names of workspace without anything breaking)
    • String: The name of the workspace
    • Number array rest: The monitor preferences. This is which monitor it should appear on, first (primary) monitor is one. E.g. 2 1 to appear on the second monitor first, but if that isn’t plugged in then use the first.
  • bind: Binds a key to a command
    • String: The key bind, structured according to the bind mode. This can also be a key chord, where you have multiple binds, where when pressed in succession will execute the command (make sure to enclose this arg in quotes, and then separate the binds with spaces)
    • String rest: The command to run
  • quitkey: Sets the key to exit a key chord (note: pressing an unbound key also does this)
    • String: The key bind, structured according to the bind mode.
  • bindmode: Sets the bind mode (Description of these further down)
    • String: The bind mode to use
  • wsDump: This is a command for testing, you probably don’t want to use it

General

You can change either the inner gaps (padding around each window - so double it for space between windows), or the outer gaps (padding around the display - add to inner gaps to get space between window and screen edges). They can be changed with the commands gaps and outerGaps in the config file (default 10 for both). YATwm also keeps a log file, the location of this file can be changed with the command logFile (default /tmp/yatlog.txt).

Workspaces

You can add workspace with the command addworkspace in the config file.

addworkspace "1: A" 1
addworkspace "2: B" 1

Defaults workspace are listed below (these are the args for the addworkspace command):

  1. “1: A” 1
  2. “2: B” 1
  3. “3: C” 1
  4. “4: D” 1
  5. “5: E” 1
  6. “6: F” 2 1
  7. “7: G” 2 1
  8. “8: H” 2 1
  9. “9: I” 2 1
  10. “10: J” 2 1

Keybinds

Current keybinds (these can all be edited):

  • mod + e : exit
  • mod + t : change next tile direction
  • mod + q : quit focused window
  • mod + shift + r : reload WM (rechecks monitors)
  • mod + direction : change focus in direction (vim keybinds)
  • mod + shift + direction : move window in direction (vim keybinds)
  • mod + enter : alacritty
  • mod + d : rofi
  • mod + c : firefox
  • mod + x : lock
  • mod + shift + x : lock and sleep
  • mod + f : toggle fullscreen
  • mod + (num) : switch to workspace (num) - currently only for 1-10 but you can add more
  • mod + shift + (num) : move window to workspace (num) - currently only for 1-10 but you can add more
  • mod + g : exit key chord

(mod is super, and the direction keys are h, j, k, l - left, down, up, right respectively like vim)

You can use the command swapmods to make mod act as alt and alt act as mod.

To add new keybinds use the bind command:

bind mod+q kill
bind mod+shift+x bashSpawn loginctl lock-session && systemctl suspend

Commands are executed going down the list and multiple commands with the same keybind and modifiers will all be executed

Bind modes

The current two bind modes are normal and emacs. The normal bind mode has the same syntax as i3, so key and modifiers separated with a ‘+’, and use the xlib KeySym name for them. The emacs bind mode has the same syntax as emacs, so separate modifiers and keys with a ‘-‘, and the key comes last. It uses xlib keysyms, but for multi letter keys such as RET, SPC, ESC, +, - it has special logic to interpret how they would be written in emacs (note: if there are any other exceptions please let me know).

Credits

Catwm (https://github.com/pyknite/catwm)

basic_wm (https://github.com/jichu4n/basic_wm)

About

[WIP] YATwm (Yet Another Tiling window manager) is as the name implies. Could also be called YAT (Yet Another Tiler) if you can't be bothered with the wm

Topics

Resources

License

Stars

Watchers

Forks