.\" Title: bspwm
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 02/06/2014
+.\" Date: 02/09/2014
.\" Manual: Bspwm Manual
.\" Source: Bspwm 0.8.8
.\" Language: English
.\"
-.TH "BSPWM" "1" "02/06/2014" "Bspwm 0\&.8\&.8" "Bspwm Manual"
+.TH "BSPWM" "1" "02/09/2014" "Bspwm 0\&.8\&.8" "Bspwm Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\}
.nf
DESKTOP_SEL := <desktop_name>
- | ^<n>
- | (CYCLE_DIR|last|focused[:MONITOR_SEL]|older|newer)[\&.occupied|\&.free][\&.urgent][\&.local]
+ | [MONITOR_SEL:]^<n>
+ | (CYCLE_DIR|last|[MONITOR_SEL:]focused|older|newer)[\&.occupied|\&.free][\&.urgent][\&.local]
.fi
.if n \{\
.RE
----
DESKTOP_SEL := <desktop_name>
- | ^<n>
- | (CYCLE_DIR|last|focused[:MONITOR_SEL]|older|newer)[.occupied|.free][.urgent][.local]
+ | [MONITOR_SEL:]^<n>
+ | (CYCLE_DIR|last|[MONITOR_SEL:]focused|older|newer)[.occupied|.free][.urgent][.local]
----
Primary Selectors
}
} else if ((colon = index(desc, ':')) != NULL) {
*colon = '\0';
- if (streq("focused", desc))
- if (monitor_from_desc(colon + 1, ref, dst))
+ if (monitor_from_desc(desc, ref, dst)) {
+ if (streq("focused", colon + 1)) {
dst->desktop = dst->monitor->desk;
+ } else if (parse_index(colon + 1, &idx)) {
+ desktop_from_index(idx, dst, dst->monitor);
+ }
+ }
} else if (parse_index(desc, &idx)) {
- desktop_from_index(idx, dst);
+ desktop_from_index(idx, dst, NULL);
} else {
locate_desktop(desc, dst);
}
return false;
}
-bool desktop_from_index(int i, coordinates_t *loc)
+bool desktop_from_index(int i, coordinates_t *loc, monitor_t *mm)
{
- for (monitor_t *m = mon_head; m != NULL; m = m->next)
+ for (monitor_t *m = mon_head; m != NULL; m = m->next) {
+ if (mm != NULL && m != mm)
+ continue;
for (desktop_t *d = m->desk_head; d != NULL; d = d->next, i--)
if (i == 1) {
loc->monitor = m;
loc->node = NULL;
return true;
}
+ }
return false;
}
bool locate_window(xcb_window_t win, coordinates_t *loc);
bool locate_desktop(char *name, coordinates_t *loc);
bool locate_monitor(char *name, coordinates_t *loc);
-bool desktop_from_index(int i, coordinates_t *loc);
+bool desktop_from_index(int i, coordinates_t *loc, monitor_t *mm);
bool monitor_from_index(int i, coordinates_t *loc);
bool node_matches(coordinates_t *loc, coordinates_t *ref, client_select_t sel);
bool desktop_matches(coordinates_t *loc, coordinates_t *ref, desktop_select_t sel);