Difference between revisions of "Monsterwm"

From ArchWiki
Jump to: navigation, search
(Method 2)
(redirect old AUR WM, see Talk:Window_manager)
 
(100 intermediate revisions by 13 users not shown)
Line 1: Line 1:
[[Category:Dynamic WMs (English)]]
+
#REDIRECT: [[Window_manager]]
== About ==
 
[https://github.com/c00kiemon5ter/monsterwm 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.
 
 
 
== Installation ==
 
=== Method 1 ===
 
Using AUR
 
 
 
Download the [https://aur.archlinux.org/packages.php?ID=55090 PKGBUILD from AUR]. Then, as a non-root user, run:
 
 
 
<pre>$ makepkg -i</pre>
 
 
 
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 [https://github.com/c00kiemon5ter/monsterwm official github repository] from github.
 
 
 
<pre>$ git clone git://github.com/c00kiemon5ter/monsterwm.git
 
$ cd monsterwm</pre>
 
 
 
To build monsterwm, run the following as a non-root user:
 
 
 
<pre>$ make</pre>
 
 
 
To install monsterwm, run the following as root:
 
 
 
<pre># make clean install</pre>
 
 
 
 
 
Before you build monsterwm, you may want to skip to the ''[Configuration]'' section to change the default configuration.
 
 
 
== 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.
 
 
 
<ul>
 
<li>MOD + h (decrease the size of a current window)</li>
 
<li>MOD + l (increase the size of a current window)</li>
 
<li>MOD + Shift + c (close current window)</li>
 
<li>MOD + j (change to next window)</li>
 
<li>MOD + Tab (move to last desktop)</li>
 
<li>MOD + k (change to previous window)</li>
 
<li>MOD + j (change to next window)</li>
 
<li>MOD + Shift + k (move current window up)</li>
 
<li>MOD + Shift + j (move current window down)</li>
 
<li>MOD + Enter (change master to current window)</li>
 
<li>MOD + t (switch to tile mode)</li>
 
<li>MOD + b (switch to bottomstack mode)</li>
 
<li>MOD + g (switch to grid mode)</li>
 
<li>MOD + m (switch to monocle mode)</li>
 
<li>MOD4 + v (open dmenu - requires dmenu)</li>
 
<li>MOD + Shift + Return (open xterm)</li>
 
<li>MOD + Left (previous desktop)</li>
 
<li>MOD + Right (next desktop)</li>
 
<li>MOD + F1-4 (change to desktop #)</li>
 
<li>MOD + Control + q (quit monsterwm with exit value 1)</li>
 
<li>MOD + Control + r (quit monsterwm with exit value 0)</li>
 
</ul>
 
 
 
you can find more information in the man page
 
<pre>$ man monsterwm</pre>
 
 
 
==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 re-selects the current tiling mode. Note, that one cannot "select" the floating mode, but it will be enabled for any window if one tries to move or resize that window with the mouse. The window is then marked, as being in floating mode.
 
 
 
==Panel==
 
 
 
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 existing desktops suchs as the number of windows and the tiling mode/layout of each desktop, the current desktop and urgent hints whenever needed. The user can use whatever tool or panel suits him best (dzen2, conky, [https://github.com/moetunes/Some_sorta_bar some-sorta-bar], w/e), to process and display that information.
 
 
 
You can find an example of how to achieve this [https://gist.github.com/1905427 here]. You can build anything you want, and display the information as you'd like. Do not be limited to that example.
 
 
 
==Patches==
 
 
 
There are several patches that extend monsterwm's functionality.
 
 
 
<ul>
 
<li>fib : adds fibonacci layout</li>
 
<li>monocleborders : adds borders to the monocle layout</li>
 
<li>showhide : adds a function to show and hide all windows on all desktops</li>
 
<li>uselessgaps : adds gaps around every window on screen</li>
 
<li>warpcursor : cursors follows and is placed in the center of the current window</li>
 
 
 
<li>bloat : bloat is merge of all patches with the current master, just for fun</li>
 
</ul>
 
 
 
To install monsterwm with a patch simply change the <pre>_gitbranch=</pre> line on the PKGBUILD to the name of the patch.
 
 
 
<hr/>
 
 
 
If you installed monsterwm with ''method 2 - using git'', you can change to the desired branch with
 
 
 
<pre>$ git checkout <branch></pre>
 
 
 
and then continue normally. For example to build monsterwm with the fibonacci layout one would do:
 
 
 
<pre>$ git checkout fib
 
$ make
 
# make clean install
 
</pre>
 
 
 
That way you can also combine patches. To do that one would <code>merge</code> another branch to the current one. For example to build monsterwm with uselessgaps, warpcursor and showhide, one would do:
 
 
 
<pre>$ git checkout uselessgaps
 
$ git merge showhide
 
$ git merge warpcursor
 
$ make
 
# make install</pre>
 
 
 
== 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''):
 
<pre>const char* thunarcmd[] = {"thunar", NULL};</pre>
 
 
 
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 monsterwm stores all of it's keybindings. An example entry for the ''thunarcmd''[] we made above would be:
 
<pre>{ MOD,    XK_t,    spawn,    {.com = thunarcmd}},</pre>
 
 
 
<ul>
 
<li>The first element specifies the first sequence that is pressed (MOD for the modkey only, MOD|ShiftMask for the modkey and then the shiftkey).</li>
 
<li>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 <code>XK_a</code> for the '''a key''', <code>XK_Space</code> for the '''space bar''', and <code>XK_1</code> 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.</li>
 
<li>The third element just specifies the function <code>spawn</code>, which has been written to be passed a command to execute. Whenever you need to start an application or do anything that is not related to the internals of monsterwm <code>spawn</code> will be used. </li>
 
<li>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 <code>{.com = thunarcmd}</code>. The .com stands for command.</li>
 
</ul>
 
 
 
After this, recompile, hope for no errors, and install.
 
 
 
==Resources==
 
* [https://bbs.archlinux.org/viewtopic.php?id=132122 monsterwm thread on the forums]
 
* [https://github.com/c00kiemon5ter/monsterwm monsterwm repository on github]
 
* [https://github.com/Cloudef/monsterwm-xcb monsterwm-xcb repository on github]
 

Latest revision as of 18:48, 15 December 2015

Redirect to: