When 'A' is followed by a 'p', the x position will be printed after the action
This commit is contained in:
parent
a447500477
commit
65e175a19e
16
bar.c
16
bar.c
|
@ -37,6 +37,7 @@ typedef struct area_t {
|
||||||
int begin, end, align;
|
int begin, end, align;
|
||||||
xcb_window_t window;
|
xcb_window_t window;
|
||||||
char *cmd;
|
char *cmd;
|
||||||
|
bool print_pos;
|
||||||
} area_t;
|
} area_t;
|
||||||
|
|
||||||
#define N 10
|
#define N 10
|
||||||
|
@ -235,6 +236,11 @@ area_add (char *str, const char *optend, char **end, monitor_t *mon, const int x
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (*p == 'W') {
|
||||||
|
a->print_pos = true;
|
||||||
|
p++;
|
||||||
|
}
|
||||||
|
|
||||||
/* A wild close area tag appeared! */
|
/* A wild close area tag appeared! */
|
||||||
if (*p != ':') {
|
if (*p != ':') {
|
||||||
*end = p;
|
*end = p;
|
||||||
|
@ -1039,7 +1045,15 @@ main (int argc, char **argv)
|
||||||
/* Respond to left click */
|
/* Respond to left click */
|
||||||
if (press_ev->detail == XCB_BUTTON_INDEX_1) {
|
if (press_ev->detail == XCB_BUTTON_INDEX_1) {
|
||||||
area_t *area = area_get(press_ev->event, press_ev->event_x);
|
area_t *area = area_get(press_ev->event, press_ev->event_x);
|
||||||
if (area) { write(STDOUT_FILENO, area->cmd, strlen(area->cmd)); write(STDOUT_FILENO, "\n", 1); }
|
if (area) {
|
||||||
|
write(STDOUT_FILENO, area->cmd, strlen(area->cmd));
|
||||||
|
if (area->print_pos) {
|
||||||
|
char pos[6];
|
||||||
|
snprintf(pos, 6, " %d", area->begin);
|
||||||
|
write(STDOUT_FILENO, pos, 6);
|
||||||
|
}
|
||||||
|
write(STDOUT_FILENO, "\n", 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user