You are not logged in.

#1 2011-12-19 00:50:56

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

monsterwm! ~ yet another tiny wm

Heya peoples,

I just wanted to announce a somewhat "new" tiny but monstrous wm.

Currently:

http://cloc.sourceforge.net v 1.55  T=0.5 s (4.0 files/s, 1582.0 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
C                                1             88             30            586
C/C++ Header                     1              8             22             57
-------------------------------------------------------------------------------
SUM:                             2             96             52            643
-------------------------------------------------------------------------------

This was branched off dminiwm/dminimalwm by moetunes which was based on catwm by pyknite and 2wm/dwm by the suckless team.

The project aims to be a usable as small as possible tiling wm. I use it personally everyday.
It's like dwm with gridlayout, bstack, pertag, dwmreturn patches, but without floating mode (minimum mouse support).

in the future I'll maybe look into floating mode, maybe get the modal windows movable and/or resizable.
I'm also keen to take a look at tagging mechanism and viewing the same window across many desktops.

It'd be nice if anyone would like to try it and report back smile (rant accepted)

~ ~ Project on Github


kudos and cookies!

Last edited by c00kiemon5ter (2012-08-06 12:00:12)


.:[ git me! ] :.

Offline

#2 2011-12-19 01:53:45

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: monsterwm! ~ yet another tiny wm

cookies >> c00kiemon5ter

Nice one. I'll have a play over the break and provide some more thoughtful feedback.

A quick question: I assume that I can pipe my own statusbar to the panel (is it just the root window?), but do you have any way to keep track of the currently used/populated workspaces?

Quick PKGBUILD hacked together for anyone that wants to give this a run:

pkgname=monsterwm
pkgver=20111219
pkgrel=1
pkgdesc="A minimal and dynamic titling window manager"
url="https://github.com/c00kiemon5ter/monsterwm"
arch=('i686' 'x86_64')
license=('GPL3')
groups=('modified')
depends=('libx11')
makedepends=('git')

_gitroot="git://github.com/c00kiemon5ter/monsterwm.git"
_gitname="monsterwm"
_gitbranch="master"

build() {
  cd ${srcdir}

  msg "Connecting to GIT server..."

  if [ -d ${_gitname} ]; then
    cd ${_gitname} && git pull origin master
    cd ..
    msg "The local files are updated."
  else
    git clone ${_gitroot} ${_gitname}
  fi

  msg "GIT checkout done or server timeout"

  msg "Removing old build directory..."
  rm -Rf ${srcdir}/${_gitname}-build
  msg "Creating build directory..."
  cp -R ${srcdir}/${_gitname} ${srcdir}/${_gitname}-build

  msg "Starting make..."
  msg "If you want to configure monsterwm, copy config.def.h to ${startdir}/config.h and edit it"

  cd ${_gitname}-build

  [[ -e ${startdir}/config.h ]] && msg "Using your config.h" && cp ${startdir}/config.h .

  make PREFIX=/usr DESTDIR="${pkgdir}" install
}

# edit: added a screenie
6535346137_0753ffa93d_t.jpg

Last edited by jasonwryan (2011-12-19 04:10:28)


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2011-12-19 02:09:25

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

thanks for the quick PKGBUILD wink and the cookies <3 !

jasonwryan wrote:

A quick question: I assume that I can pipe my own statusbar to the panel (is it just the root window?), but do you have any way to keep track of the currently used/populated workspaces?

no, there is no built in panel. One can define an empty space on the bottom or top of the screen, to be used by a panel. But the panel is not build in. You can use dzen, conky, statnot, w/e fits you best.

I'm not sure if a panel is something that a wm should do. The wm should surely know if a panel is there, but I don't think it's the wm's job to provide one.

So as no panel is provided by the wm, there is no way to "name" or show the names of your desktops or know which are populated.

On the one hand I would like to do that too, know which desktops have windows open. On the other this is pretty minimal, so it may be good this way. If I come up with something that can provide this kind of info I'll surely give it a try, but I don't think I want to do it as say, dwm does it, by providing a panel itself.

However, moetunes has worked on what you want, on the bigger snapwm. Check this topic for more on that smile

Last edited by c00kiemon5ter (2011-12-19 02:09:59)


.:[ git me! ] :.

Offline

#4 2011-12-19 02:25:12

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

Also here's couple of screenshots - monsterwm with dzen panel (toggled on the last two)

tYnQ0bA  tYnQ0bQ  tYnQ0bw  tYnQ0cg

Last edited by c00kiemon5ter (2011-12-19 02:28:35)


.:[ git me! ] :.

Offline

#5 2011-12-19 07:53:07

ivoarch
Member
Registered: 2011-03-31
Posts: 436

Re: monsterwm! ~ yet another tiny wm

Looks great, added to the AUR
https://aur.archlinux.org/packages.php?ID=55090


I love GnuEmacs, GnuScreen, ratpoison, and conkeror.
Github )||( Weblog

Offline

#6 2011-12-19 22:57:17

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: monsterwm! ~ yet another tiny wm

Have got it set up properly now C00kie. A couple more questions: is there any way to launch a shell command from a keybind? I tired SHCMD, but that obviously doesn't work... Also, in the rules section, how do you hook to titles (as in terminal apps where the class is NULL, like mutt)?

And a patch for config.h wink

#define MOD4            Mod4Mask  /* Super/Windows key */
+ #define CONTROL         ControlMask
#define MASTER_SIZE     0.52

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#7 2011-12-19 23:37:50

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

Pushed the definition of control and shift buttons. Thanks smile

SHCMD should work just by defining it as in dwm on config.h but substituting .v with .com
like this:

#define SHCMD(cmd) { .com = (const char*[]){ "/bin/bash", "-c", cmd, NULL } }

Edit: pushed too

Last edited by c00kiemon5ter (2011-12-19 23:55:15)


.:[ git me! ] :.

Offline

#8 2011-12-20 01:34:24

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

Alright, looking into the "NULL" class by apps running inside terminals, I can only see this solution:

The rules need the user to provide the class for the app that the rule will act upon. A terminal is itself just another application with its own class. Running a process inside a terminal doesn't change the terminal's class ofcourse.

However most (all of which I know) terminal emulators, provide the functionality to change the terminal's class/title/icon name before spawning the terminal, and also provide the functionality to run a command on spawn.

So one solution would be to start apps like this

$ urxvt -name mutt -e mutt      # start a urxvt terminal with class name "mutt" and run 'mutt'
$ urxvtc -name mpd -e ncmpcpp   # start a urxvt client terminal with class name "mpd" and run 'ncmpcpp'

'-name' is the case for urxvt, look in the man page of the terminal emulator you use for the corresponding switch, ie. st uses '-c' to change the class name

defining rules for those classes, monsterwm will (almost) pick them up and do the appropriate thing

 ..
{ "mutt",   2,   True  }, /* follow mutt class to the specified desktop */
{ "mpd",    1,   False }, /* open mpd class (ncmpcpp from above) in the specified desktop */
.. 

The almost part consists of this:
running xprop on a terminal (or any other window actually) returns this for the window class

# xrpop on urxvt
..
WM_CLASS(STRING) = "urxvt", "URxvt"
..

# xprop on urxvt -name mpc
..
WM_CLASS(STRING) = "mpc", "URxvt"
..

monsterwm currently checks just the second part of that line, so even if you do '-name mpc' monsterwm will still see "URxvt". I can very easilly fix this to look both.

I've already tested it and works as expected.

---------------------------------------------------------------

The drawback of this solution is that you need a way to set the class of your app before you spawn it.
I can think of a couple of ways to do that:

1. set up aliases in your shell's rc/configuration file for the apps you need to manage, like so:

alias mutt="urxvtc -name mutt -e mutt"

or a somewhat more automatic way

classify() {
    local _term="urxvtc" _classopt="-name"
    for app in "$@"; do
        alias $app="${_term} ${_classopt} ${app} -e ${app}"
    done
}

classify mutt ncmpcpp

2. the second way could be defining another helper like SHCMD which would do the same as classify above

#define CLSFY(cmd) {.com = (const char*[]){"urxvt", "-name", cmd, "-e", cmd, NULL}}
static key keys[] = {
    {  MOD4,             XK_y,          spawn,             CLSFY("ncmpcpp")},
...

however you would need to define a different shortcut for each of the apps you want monsterwm to handle, which isn't that convinient.

---------------------------------------------------------------

That leaves one thing that might be annoying: All of this works but spawns a new terminal.
Aliasing mutt, and running mutt, won't move the current terminal to another desktop, but will spawn a new one and monsterwm will handle that. However there is no way to change a terminal's class name, while it has been spawned.

So that would leave me with, having to check the terminal title changes (and forgetting about all of the above). If the title changes to "mutt .*" act on that, but that is not clean nor in any way elegant, and many cli apps out there, don't even set a different title, plus navigating to mutt's webpage would cause the browser's title to change to mutt and thus match the rule. I think you get the picture of the mess that would be caused..

Another approach would be to check the class to match a terminal (ie "urxvt") and then the title to match the app (ie "mutt"); that is adding a field on the rules for the app title. That would save us from some "errors" but still isn't good enough.

---------------------------------------------------------------

To sum up, I think the easiest and cleanest solution is to use the classify() function and I'll patch monsterwm in a moment to check both strings in the class name, so that this works.

I don't think I can do any better than that. As explained in the beggining, the wm see's the terminal emulator's class name and checks to match a rule for that string. There is nothing it can do to find the running app on that terminal.

I hope that's good enough smile
If anyone has any idea on that, please come forward

btw: thanks for using this!


.:[ git me! ] :.

Offline

#9 2011-12-20 05:43:34

cms07
Member
Registered: 2011-01-01
Posts: 8

Re: monsterwm! ~ yet another tiny wm

I just started looking for a tiling window manager. Monsterwm suits my needs nicely so far. I am interested in developing on this, so: what is the plan for this? Are there any particular features/changes in the plans?

Offline

#10 2011-12-20 09:10:23

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

I am very happy with its current state. What I'll be looking into in the future is three things:

1) floating mode support for modal/transient windows, so one could move around pop-up windows in gimp, for example. If that works nicely, I will consider floating mode in general, but only if that's worth it (code size, bugs it will bring, etc)

2) I would like to implement some kind of multiview support; that is I would like to have my irssi open on both desktop1 and desktop2, same instance, same window, or in other words, have some windows on desktop1, have irssi on desktop2 and be able to merge those windows and then split again. That's actually tagging.

3) As jasonwryan said above, I would also like to store some info of whether a specified desktop has open windows. Note that monsterwm does not provide a panel, like dwm does. As I said above I don't think it's a wm's job to present and handle the panel. Also I don't think there's any point in presenting desktop names ("web" "dev" "foo" etc). What I'll be looking into is outputting/reporting on stdout or stderr which desktops have how many windows. That way one could parse the output and look for those lines, grab the wanted info, and present it in his favorite panel (dzen2, conky etc).
Implemented that way, is really easy; I just have to decide on the output stream(stdout probably) and format(easily parsable to be presented). I may even try this today if I get the time (have to leave for the university now).

I'm also aware of a bug, or not sure if it's a bug, cause Chromium behaves strange anyway (for example start a wm/de and open chromium - start a wm/de on another display, try to start chromium now tongue window open on the first display (!?) ) .
If one opens chromium on desktop1, switch to desktop2 and open a link (eg using urxvt-url-select) weirds things happen. Will have to look into that too.

That's it for now. More ideas and different approaches are welcome smile


.:[ git me! ] :.

Offline

#11 2011-12-21 07:03:00

stalphonzo
Member
Registered: 2009-10-01
Posts: 8

Re: monsterwm! ~ yet another tiny wm

Hey c00kiemon5ter,
I'm really enjoying monsterwm for a week now.
Especially features like toggable status bar complete the tiling experience.
The only problem I've found so far is gvim.
At first I thought it was a problem with gvim itself, but with dminiwm e.g. it doesn't occur.
It seems like gvim did not update the menu elements.
I wonder if someone else is experiencing that issue.

Offline

#12 2011-12-21 07:09:27

stlarch
Member
From: hell
Registered: 2010-12-25
Posts: 1,265

Re: monsterwm! ~ yet another tiny wm

Thanks for this. It's pretty cool. I have one problem. How would I define the colors and font in dmenu? I tried

static const char *dmenucmd[] = { "dmenu_run -fn -*-ohsnap-medium-r-normal-*-11-*-*-*-*-*-*-* -i -nb #000000 -nf #7f7f7f -sb #000000 -sf #b3b3b3", NULL };

but it's not working. Can someone point me in the right direction? Thanks

Last edited by stlarch (2011-12-22 08:47:25)

Offline

#13 2011-12-21 07:36:57

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: monsterwm! ~ yet another tiny wm

Moar escaping...

static const char *dmenucmd[]    = { "dmenu_run", "-fn", "-*-tamsyn-medium-*-*-*-14-*-*-*-*-*-iso8859-*", "-nb", "#121212", "-nf", "#333333", "-sb", "#121212", "-sf", "#C0C0C0", NULL };

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#14 2011-12-21 07:43:46

stlarch
Member
From: hell
Registered: 2010-12-25
Posts: 1,265

Re: monsterwm! ~ yet another tiny wm

Thanks dude. I was going to try that. I swear.

edit: Here's my current setup. I'm really liking it!

tYnY5OQ

Last edited by stlarch (2011-12-22 17:18:41)

Offline

#15 2011-12-21 15:43:03

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

stlarch wrote:

Thanks dude. I was going to try that. I swear.

edit: Here's my current setup. I'm really liking it!

http://ompldr.org/tYnY5OQ

nice wink cookies!!


I'm still not back home, so I didn't have time to look into anything yet.

stalphonzo wrote:

Hey c00kiemon5ter,
I'm really enjoying monsterwm for a week now.
Especially features like toggable status bar complete the tiling experience.
The only problem I've found so far is gvim.
At first I thought it was a problem with gvim itself, but with dminiwm e.g. it doesn't occur.
It seems like gvim did not update the menu elements.
I wonder if someone else is experiencing that issue.

I don't use gvim, so I'm not sure what that bug is about.
I will look into it once I get back, I think I may know what the cause is.

Last edited by c00kiemon5ter (2011-12-23 00:55:42)


.:[ git me! ] :.

Offline

#16 2011-12-21 18:34:03

Ypnose
Member
From: Jailed in the shell
Registered: 2011-04-21
Posts: 353
Website

Re: monsterwm! ~ yet another tiny wm

Hum. This WM is tempting. I really like light WM as dwm. I will take a look. It could be good to implement a good multi-monitor setup.
Cheers.


Github -- My terminal font Envypn

Offline

#17 2011-12-22 10:06:02

mah0
Member
Registered: 2011-04-21
Posts: 47

Re: monsterwm! ~ yet another tiny wm

Hi. How can I set key combination with multimedia keys (XF86AudioPlay etc.)?

Offline

#18 2011-12-22 12:03:51

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

You would need to include XF86keysym.h to monsterwm.c

diff --git a/monsterwm.c b/monsterwm.c
index 34583cf..40dce80 100644
--- a/monsterwm.c
+++ b/monsterwm.c
@@ -25,6 +25,7 @@
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 #include <X11/keysym.h>
+#include <X11/XF86keysym.h>
 #include <X11/Xproto.h>
 #include <X11/Xatom.h>

Save this file as say xf86keys.diff and do

patch -p1 < xf86keys.diff

rebuild it, and keys should work now.


Ypnose wrote:

Hum. This WM is tempting. I really like light WM as dwm. I will take a look. It could be good to implement a good multi-monitor setup.
Cheers.

I don't have a second screen actually, so that would be difficult for me to try and test, but I can assign this to a friend of mine tongue Currently I will be working on the two bugs reported above, and then the list of 3 items above

Last edited by c00kiemon5ter (2011-12-22 12:06:37)


.:[ git me! ] :.

Offline

#19 2011-12-22 13:39:45

mhertz
Member
From: Denmark
Registered: 2010-06-19
Posts: 681

Re: monsterwm! ~ yet another tiny wm

Btw, instead of including XF86keysum.h, then atleast in dwm, you can opt to define keycodes instead, like e.g. 0x1008ff13 and 0x1008ff12 etc. and so maybe that also works in monsterwm...

Also, it's nice to see that the things that is holding me back from monsterwm, is also on the todo/wish-list, and here i'm reffering to tagging support, ability to parse which tags has clients on, so that we can emulate dwm's statusbar function with filed/empty squares, and floating support just for pop-up/transient windows...

Not that i'm not happy with dwm, but I always appreciate a lighter alternative so long as it fullfills my requirements...

Last edited by mhertz (2011-12-22 13:43:22)

Offline

#20 2011-12-22 21:04:05

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

stalphonzo wrote:

The only problem I've found so far is gvim.
At first I thought it was a problem with gvim itself, but with dminiwm e.g. it doesn't occur.
It seems like gvim did not update the menu elements.

alright, this should be fixed now, as should the bug with chromium.
note that I'm kind of not following the spec here. let me explain myself.

Some windows don't like arbitary sizes(like gvim), which creates some gaps on tiled windows. I kinda discard that, and force to fill the gaps. If you don't like that or don't want that, one must revert commit 4736c56 to respect the window's wanted width and height.

Other than that I added a configuration variable (MINWSZ) to determine the minimum window size(width and or height). That's because as it was before, one could increase the master size area to exceed screen size, and some windows need a minimum width or height to stay alive (like gvim). I will also do the same with the first stack window, which is resizable.

Last edited by c00kiemon5ter (2011-12-23 00:56:36)


.:[ git me! ] :.

Offline

#21 2011-12-22 22:45:44

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

c00kiemon5ter wrote:

Other than that I added a configuration variable (MINWSZ) to determine the minimum window size(width and or height). That's because as it was before, one could increase the master size area to exceed screen size, and some windows need a minimum width or height to stay alive (like gvim). I will also do the same with the first stack window, which is resizable.

This is a bit tricky. I think I won't "fix" this. What should happen if the growing window gets to the point where the other windows are as small as MINWSZ declared ? and if a new window appears ? or what happens if the windows on the screen are so many, that their size should be smaller than what MINWSZ says ?
I don't know. So, I won't fix this. On the other hand, if the user makes the windows that small, that they can't draw themselves, they're probably unusable anyway. If you have a better idea let me know.

Last edited by c00kiemon5ter (2011-12-23 00:58:40)


.:[ git me! ] :.

Offline

#22 2011-12-23 00:49:35

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

With the latest push, windows can be moved freely, not just in the stack.
I also got rid of two full for loops over the windows (the tiniest optimization ever tongue).

Last edited by c00kiemon5ter (2011-12-23 00:59:02)


.:[ git me! ] :.

Offline

#23 2011-12-23 01:41:39

cms07
Member
Registered: 2011-01-01
Posts: 8

Re: monsterwm! ~ yet another tiny wm

I know that this isn't exactly important, but are you expecting to implement configuration files that can be changed without recompiling? That would make it much easier to customize while using a package manager, I would think. If that's not something you are interested in, I am going to make it happen anyway.

Offline

#24 2011-12-23 02:03:37

c00kiemon5ter
Member
From: Greece
Registered: 2010-06-01
Posts: 562
Website

Re: monsterwm! ~ yet another tiny wm

cms07 wrote:

I know that this isn't exactly important, but are you expecting to implement configuration files that can be changed without recompiling? That would make it much easier to customize while using a package manager, I would think. If that's not something you are interested in, I am going to make it happen anyway.

no, I won't be doing that, I don't think it's in the spirit of this wm.

Having a config.h as a configuration is easy enough to manage. Using an external configuration that wouldn't need to be compiled, can be unsafe and needs lots of parsing code. I think there are more interesting things to be done at the moment.

However, give us a heads up, if you go forward with that wink This can actually be done without affecting any of the current code, just adding a new method and a shortcut to re-read the configuration. All it would do is get the new/default values and reset them internally. If you have it working, this can be maintained as a patch, for anyone that would like it.

Last edited by c00kiemon5ter (2011-12-23 02:04:51)


.:[ git me! ] :.

Offline

#25 2011-12-23 10:38:44

stalphonzo
Member
Registered: 2009-10-01
Posts: 8

Re: monsterwm! ~ yet another tiny wm

Your fix seems to work when gvim isn't the only window in workspace and layout isn't monocle.
In other words: in case gvim can take the full screen the annoying behaviour appears.
I think i'm going to revert the concerning commit, though at the moment I guess it's the cleaner solution and
I don't want to bother you with such annoying stuff.

EDIT:
Now reverted the commit and it works quite well.
Thanks for that.

Last edited by stalphonzo (2011-12-23 10:51:21)

Offline

Board footer

Powered by FluxBB