rotate clockwise|counter_clockwise|full_cycle
Rotate the tree of the current desktop.
- rule PATTERN floating
- Make a new rule that will float the windows whose class name or instance name equals PATTERN.
+ rule PATTERN [DESKTOP_NAME] [floating]
+ Create a new rule (PATTERN must match the class or instance name).
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 floating "
-Make a new rule that will float the windows whose class name or instance name equals PATTERN.
+.BI rule " PATTERN [DESKTOP_NAME] [floating] "
+Create a new rule (PATTERN must match the class or instance name).
.TP
.BI adopt_orphans
Manage all the unmanaged windows remaining from a previous session.
strncpy(rule->cause.name, name, sizeof(rule->cause.name));
char *arg = strtok(NULL, TOKEN_SEP);
while (arg != NULL) {
- if (strcmp(arg, "floating") == 0)
+ if (strcmp(arg, "floating") == 0) {
rule->effect.floating = true;
+ } else {
+ desktop_location_t loc;
+ if (locate_desktop(arg, &loc)) {
+ rule->effect.monitor = loc.monitor;
+ rule->effect.desktop = loc.desktop;
+ }
+ }
arg = strtok(NULL, TOKEN_SEP);
}
rule->next = rule_head;
return false;
}
-void handle_rules(xcb_window_t win, bool *floating, bool *transient, bool *fullscreen, bool *takes_focus, bool *manage)
+void handle_rules(xcb_window_t win, monitor_t **m, desktop_t **d, bool *floating, bool *transient, bool *fullscreen, bool *takes_focus, bool *manage)
{
xcb_ewmh_get_atoms_reply_t win_type;
while (rule != NULL) {
if (is_match(rule, win)) {
- if (rule->effect.floating)
+ rule_effect_t efc = rule->effect;
+ if (efc.floating)
*floating = true;
+ if (efc.monitor != NULL && efc.desktop != NULL) {
+ *m = efc.monitor;
+ *d = efc.desktop;
+ }
}
rule = rule->next;
}
#define _RULES_H
bool is_match(rule_t *, xcb_window_t);
-void handle_rules(xcb_window_t, bool *, bool *, bool *, bool *, bool *);
+void handle_rules(xcb_window_t, monitor_t **, desktop_t **, bool *, bool *, bool *, bool *, bool *);
#endif
{
rule_t *r = malloc(sizeof(rule_t));
r->effect.floating = false;
+ r->effect.monitor = NULL;
+ r->effect.desktop = NULL;
r->next = NULL;
return r;
}
typedef struct {
bool floating;
+ monitor_t *monitor;
+ desktop_t *desktop;
} rule_effect_t;
typedef struct rule_t rule_t;
bool floating = false, transient = false, fullscreen = false, takes_focus = true, manage = true;
- handle_rules(win, &floating, &transient, &fullscreen, &takes_focus, &manage);
+ handle_rules(win, &m, &d, &floating, &transient, &fullscreen, &takes_focus, &manage);
if (!manage) {
window_show(win);