diff --git a/README.md b/README.md index 9942e84..781d7a4 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,11 @@ Some elements that proved to be the wrong direction for xoat have been removed. * Snapshot allows the freedom to mess windows up then quicky revert to a known state. * Some EWMH desktop atoms have been dumped as surplus to requirements. - +### config.h + +All customization happens in config.h. See in-line comments there. + +**Note**: config.h is tracked! Use a local git branch to protect any customization. diff --git a/config.h b/config.h index 98111ee..c457281 100644 --- a/config.h +++ b/config.h @@ -103,6 +103,7 @@ binding keys[] = { { .mod = Mod4Mask, .key = XK_r, .act = ACTION_ROLLBACK }, // Find or start apps by WM_CLASS (lower case match). + // Only works for apps that use some form of their binary name as their class... { .mod = AnyModifier, .key = XK_F1, .act = ACTION_FIND_OR_START, .data = "urxvt" }, { .mod = AnyModifier, .key = XK_F2, .act = ACTION_FIND_OR_START, .data = "chromium" }, { .mod = AnyModifier, .key = XK_F3, .act = ACTION_FIND_OR_START, .data = "pcmanfm" }, diff --git a/xoat.c b/xoat.c index f325a83..bd5da58 100644 --- a/xoat.c +++ b/xoat.c @@ -513,8 +513,9 @@ void action_find_or_start(void *data, int num, client *cli) { int i; client *c; char *class = data; - for_windows(i, c) if (c->manage && !strcasecmp(c->class, class)) - { client_activate(c); return; } + for_windows(i, c) + if (c->visible && c->manage && c->class && !strcasecmp(c->class, class)) + { client_activate(c); return; } exec_cmd(class); } @@ -579,7 +580,7 @@ void action_rollback(void *data, int num, client *cli) for (i = snapshot.depth-1; i > -1; i--) { if ((s = snapshot.clients[i]) && (c = window_build_client(s->window)) - && !strcmp(s->class, c->class) && c->visible && c->manage) + && c->class && !strcmp(s->class, c->class) && c->visible && c->manage) { client_place_spot(c, s->spot, s->monitor, 1); client_raise_family(c);