[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Need input: Rule IDs
- To: herbstluftwm _minus_ devel _at_ lists _dot_ sourceforge _dot_ net
- Subject: [PATCH] Need input: Rule IDs
- From: Tyler Thomas Hart <tylerthomashart _at_ gmail _dot_ com>
- Date: Thu, 13 Dec 2012 20:15:56 -0800
Hi yall,
I've started some work on implimenting rule IDs. It's no where near ready, althought it's completely functional right now. Just thought I'd get some input before I bothered doing anything more than this.
...
Gives each rule an index, which is an incremented int. Adds command
'list_rules' which lists rules along with their index. Adds flag
printid which prints the window's index to stdout when a rule is
created. Added support for unrule to delete rule by index.
...
The index (unsigned int) is added to the HSRule struct, and the global index is just incremented each time a rule is created. Deleting a rule is just going through the queue looking for a matching index member.
I need ideas on printing the regex_t stored for regex conditions.
As far as /naming\ rules:
It's totally possible to name rules client-side. With the 'printid' flag, the id can be captured in a script as output, and assigned to a variable.
If server-side naming is wanted, it would require an additional member, and an additional search function. Not sure if this is ideal. If naming and not-indexing is more ideal, thats fine, we can change how this works.
We need to decide a way how to handle the rare-rare cases when the index rolls over.
All changes are attached as a single patch.
Thanks!
Tylo
Attachment:
0001-Adds-support-for-rule-IDs.patch
Description: Binary data