Difference between revisions of "Monsterwm"

From ArchWiki
Jump to navigation Jump to search
(Method 2)
Line 14: Line 14:
=== Method 2 ===
=== Method 2 ===
Using git.
Using git (recommended by monsterwm's author).
Clone the [https://github.com/c00kiemon5ter/monsterwm official github repository] from github.  
Clone the [https://github.com/c00kiemon5ter/monsterwm official github repository] from github.  

Revision as of 02:21, 25 February 2012


Monsterwm is a minimal, lightweight, tiny but monsterous dynamic tiling window manager. It will try to stay as small as possible. Currently under 750 lines with the config file included. It provides a set of different layout modes (see below), and has partial floating mode support. Each virtual desktop has its own properties, unaffected by other desktops' settings.


Method 1

Using AUR

Download the PKGBUILD from AUR. Then, as a non-root user, run:

$ makepkg -i

while in the directory of the saved PKGBUILD. All the files will be retrieved, the package will be built and installed.

Method 2

Using git (recommended by monsterwm's author).

Clone the official github repository from github.

$ git clone git://github.com/c00kiemon5ter/monsterwm.git
$ cd monsterwm

To build monsterwm, run the following as a non-root user:

$ make

To install monsterwm, run the following as root:

# make clean install

Before you build monsterwm, you may want to skip to the Configuration section to change the default configuration.


Monsterwm uses it's config.h file for configuration. By default, some hotkeys are already set.

Note: the default MOD1 key is the Alt key.

  • MOD + h (decrease the size of a current window)
  • MOD + l (increase the size of a current window)
  • MOD + Shift + c (close current window)
  • MOD + j (change to next window)
  • MOD + Tab (move to last desktop)
  • MOD + k (change to previous window)
  • MOD + j (change to next window)
  • MOD + Shift + k (move current window up)
  • MOD + Shift + j (move current window down)
  • MOD + Enter (change master to current window)
  • MOD + t (switch to tile mode)
  • MOD + b (switch to bottomstack mode)
  • MOD + g (switch to grid mode)
  • MOD + m (switch to monocle mode)
  • MOD4 + v (open dmenu - requires dmenu)
  • MOD + Shift + Return (open xterm)
  • MOD + Left (previous desktop)
  • MOD + Right (next desktop)
  • MOD + F1-4 (change to desktop #)
  • MOD + Control + q (quit monsterwm with exit value 1)
  • MOD + Control + r (quit monsterwm with exit value 0)

Floating Mode

In floating mode one can freely move and resize windows in the screen space. Changing desktops, adding or removing floating windows, does not affect the floating status of the windows. Windows will revert to their tiling mode position once the user selects a tiling mode. Note, that one cannot "select" the floating mode, but it will be enabled if one tries to move or resize a window with the mouse. Once one does that, then the window is marked as being in floating mode.


The user can define an empty space on the bottom or top of the screen, to be used by a panel. The panel is toggleable, but will be visible if no windows are on the screen. Monsterwm does not provide a panel and/or statusbar itself. Instead it adheres to the UNIX philosophy and outputs information about the existent desktop, the number of windows on each, the mode of each desktop, the current desktop and urgent hints whenever needed. The user can use whatever tool or panel suits him best (dzen2, conky, w/e), to process and display that information.


  • fib : adds fibonacci layout
  • monocleborders : adds borders to the monocle layout
  • showhide : adds a function to show and hide all windows on all desktops
  • uselessgaps : adds gaps around every window on screen
  • warpcursor : cursors follows and is placed in the center of the current window
  • bloat : bloat is merge of all patches with the current master, just for fun
  • To install monsterwm with a patch simply change the
    line on the PKGBUILD to the name of the patch.

    Add Custom Keybindings

    To add custom keybindings, you must edit config.h and recompile monsterwm. That's why it is important to set them up on the initial installation to avoid having to do this again. I'll show you a scenario in which you would need to add a keybinding to open the thunar filemanager with MOD+t.

    First, you must add a line such as the following underneath the already-defined const char*s (Note: You can name it whatever you want. In this case, I named it thunarcmd):

    const char* thunarcmd[] = {"thunar", NULL};

    I'll explain this a little more in detail. The part after the const char* and before the [] is the title, which is thunarcmd. Inside the curly brackets is where you enter the command to be executed. Each command fragment that is seperated by a space is it's own value. What I mean by that is that the command sequence ncmpcpp next would be entered as {"ncmpcpp", "next", NULL}. The NULL value must be included at the end of each hotkey.

    To actually register the hotkey with the window manager, you must look below that at the struct named keys[]. This is where catwm stores all of it's keybindings. An example entry for the thunarcmd[] we made above would be:

    { MOD,     XK_t,     spawn,     {.com = thunarcmd}},
    • The first element specifies the first sequence that is pressed (MOD for the modkey only, MOD|ShiftMask for the modkey and then the shiftkey).
    • The second element specifies the actual key that is pressed to differenciate it from other similar hotkeys. In this case, we set it to t, which has "XK_" in front of it because that's how Xorg reads key presses. Just remember to include "XK_" in front of it and you'll be fine. Some examples of these include XK_a for the a key, XK_Space for the space bar, and XK_1 for the 1 key. Note that these are case-sensitive, so XK_a is not the same as XK_A. So for this example, the entire hotkey senquence that needs to be pressed is MOD+t.
    • The third element just specifies the function spawn(), which has been written to pass the command to the shell for execution. You do not really need to know what spawn is for, so simply include it for things like this.
    • The final element inside the brackets specifies which char that was previously defined to use. In our case, it was thunarcmd[]. so we would do {.com = thunarcmd}. The .com stands for command.
    • After this, recompile, hope for no errors, and install.