One Ring to ProgramRule Them All

Aug 25, 2012 at 5:54 AM

Okay, first of all, I am really sorry for the lame pun in this subject, but it seemed fitting enough.

Fairly new to both python and Windawesome (I am, however, a C# developer and I'm very familiar with Awesome WM for Linux), and I was wondering how I could apply a ProgramRule to all windows. Is this possible?

I noticed this where it says "ProgramRule() # an all-catching rule in the end to manage all other windows", but I can't seem to apply any rules to this. Any help would be much appreciated, and I'm sorry if this question is really simple, haha.

Aug 25, 2012 at 8:07 AM


Well it depends on what you mean by "I can't seem to apply any rules to this". :) You mean that you do something like:

    rules = [ProgramRule.Rule(isFloating = True)]

And it doesn't work? Most likely the reason is that a rule before that was 'hit'. The last rule, the all-catching one, is seldomly reached as there's a lot of other rules before it which manage a lot of windows - like rules for popups, rules for dialogs, etc. I'm not sure why else wouldn't it work. You could always try debugging - download the source, compile and run - and try to figure out why some other rule is being used instead of the last one. Keep in mind that it is possible that even the last rule doesn't match any window - as there is a "customMatchingFunction" that is applied to each window too. Take a look at the Config.cs file.

btw, definitely the best way to use Windawesome, I think, is to write a single program rule (with className) for each of your mostly used programs.

Hope this helps. :)

Aug 25, 2012 at 8:42 AM

First of all, thanks for the excellent reply. I'm very grateful!

Second of all, my guess is that you're right. I'm very new to a lot of this scripting (python and ruby, specifically), so I have a hard time making sense of some of it, but ultimately, it seems that when I make any changes including "titlebar = State.HIDDEN", Windawesome refuses to even start up for various reasons. However, I'll definitely look into it! Also, I apologize if I sound less intellectually-capable than one would expect. I'm really just fairly tired. I also wanted to say great work on this project. As I mentioned before, I love to use AwesomeWM on some of my Linux boxes, so having a similar interface in Windows is a more than pleasant experience.

Thanks for your help. (:

Aug 25, 2012 at 8:45 AM

Also, my ultimate goal, here, is to set the "titlebar" state to "HIDDEN" by default. Sorry for being so vague!

Aug 25, 2012 at 8:55 AM

I see. So you most likely want this:

    rules = [ProgramRule.Rule(titlebar = State.HIDDEN, windowBorders = State.HIDDEN)]

And be sure to put that kind of rule (the part with the "ProgramRule.Rule(titlebar = State.HIDDEN, windowBorders = State.HIDDEN)") on all other rules for your own programs that you use.

Note, however, that Windows is buggy as hell and programs for it even more, so many times that won't work. Many times programs draw their own titlebars/buttons/etc (like iTunes, e.g, and many others) so you can't hide the titlebar either. :)

Aug 25, 2012 at 8:59 AM
Edited Aug 25, 2012 at 9:02 AM

Also, while I'm getting answers, how many of these ProgramRules are necessary? I tried deleting the sample collection of rules and only specifying a couple of my own, but Windawesome didn't seem to like this.


EDIT: Strike that. It seems as though now it's fine with everything. (:


Thank you so much for being so helpful!

Aug 25, 2012 at 9:19 AM

No problem! :) If you have more problems, be sure to write. :)