Hello,I've been working on a command called 'query'. It can query the state of the current layout, returning an integer, and either print the integer to stdout or compare the integer to another integer, given as an additional argument. From my man pages:COMMANDS:query QUERY [OPERATOR VALUE]Evaluates the query QUERY and compares it to VALUE. If the comparison is TRUE, then "query" returns 0,otherwise, it returns a nonzero. Valid comparison operators are:o "eq": equalo "ne": not equalo "gt": greater thano "lt": less thano "ge": greater than or equal too "le": less than or equal toIf OPERATOR and VALUE are ommited, then "query" simply prints the value to stdout. For a list of queries,see section below. Further explaination is also in that section.QUERIES:Queries check the state of the current tag, frame or window and return an integer value. Queries areevaluated using the query command and can be used to allow decision trees to be created with and and or. Theyalso can be used in place of where parsing layout or dump is unneeded in a script.Valid queries are:nframesreturns the number of frames on the current tag.nwindowsreturns the number of windows on the current frame.nwindows_allreturns the number of windows on the current tag.ntagsreturns the total number of tags.I've made several (12) commits to this branch so far, so I can rebase if needed. Otherwise, the patches for each commit are attached to this email or alternatively available at https://github.com/htylo/hlwm_patches/tree/master/query . Since adding new queries is pretty straight forward. I've mirrored my branch at https://github.com/htylo/hlwm_query.git . I'll be pushing to there as soon as I add more queries (ones for window, tag, and monitor indexes are next), so if pulling/merging from there at stable heads is preferred, let me know. Otherwise I'll be flooding the mailing list for the next couple of weeks :) . As always, suggestions are welcome.Tylo
Attachment:
0013-Added-queries-for-the-monitor-tag-and-window-index-i.patch
Description: Binary data
Attachment:
0014-Making-progress-on-command-completion-for-queries.patch
Description: Binary data