rule PATTERN [DESKTOP_NAME] [floating]
Create a new rule (PATTERN must match the class or instance name).
+ remove_rule UID ...
+ Remove the rules with the given UIDs.
+
adopt_orphans
Manage all the unmanaged windows remaining from a previous session.
.BI rotate " clockwise|counter_clockwise|full_cycle"
Rotate the tree of the current desktop.
.TP
-.BI rule " PATTERN [DESKTOP_NAME] [floating] "
+.BI rule " PATTERN [DESKTOP_NAME] [floating]"
Create a new rule (PATTERN must match the class or instance name).
.TP
+.BI remove_rule " UID ..."
+Remove the rules with the given UIDs.
+.TP
.BI adopt_orphans
Manage all the unmanaged windows remaining from a previous session.
.TP
add_rule(rule);
}
return;
+ } else if (strcmp(cmd, "remove_rule") == 0) {
+ char *arg;
+ unsigned int uid;
+ while ((arg = strtok(NULL, TOK_SEP)) != NULL)
+ if (sscanf(arg, "%X", &uid) > 0)
+ remove_rule(uid);
+ return;
} else if (strcmp(cmd, "alternate") == 0) {
focus_node(mon, mon->desk, mon->desk->last_focus, true);
return;
}
}
+void remove_rule(unsigned int uid)
+{
+ rule_t *r = find_rule(uid);
+ if (r != NULL) {
+ rule_t *prev = r->prev;
+ rule_t *next = r->next;
+ if (prev != NULL)
+ prev->next = next;
+ if (next != NULL)
+ next->prev = prev;
+ if (r == rule_head)
+ rule_head = next;
+ if (r == rule_tail)
+ rule_tail = prev;
+ }
+}
+
+rule_t *find_rule(unsigned int uid)
+{
+ for (rule_t *r = rule_head; r != NULL; r = r->next)
+ if (r->uid == uid)
+ return r;
+ return NULL;
+}
+
bool is_match(rule_t *r, xcb_window_t win)
{
xcb_icccm_get_wm_class_reply_t reply;
#define _RULES_H
void add_rule(rule_t *);
+void remove_rule(unsigned int);
+rule_t *find_rule(unsigned int);
bool is_match(rule_t *, xcb_window_t);
void handle_rules(xcb_window_t, monitor_t **, desktop_t **, bool *, bool *, bool *, bool *, bool *);
void list_rules(char *);