diff --git a/config.h b/config.h index a441b2a..67c42d3 100755 --- a/config.h +++ b/config.h @@ -12,8 +12,8 @@ #define SMENUFGCOL 0x000000 #define SMENUBGCOL 0x1f9b92 -// #define SHOWSTICK -// #define VIRTNOTIFY +//#define SHOWSTICK +#define VIRTNOTIFY #define SHORTCUTMOD Mod4Mask #define MODBITS (1<<6) @@ -43,3 +43,18 @@ #define LAUNCH_KEY XK_slash +#define AUTOSTICK {\ + "XOsview",\ + 0\ +} + +#define FONTLIST {\ + "*-lucidatypewriter-medium-*-12-*-75-*",\ + "lucm.latin1.9",\ + "blit",\ + "*-lucidatypewriter-bold-*-14-*-75-*",\ + "9x15bold",\ + "fixed",\ + "*",\ + 0\ +} diff --git a/main.c b/main.c index 4cab018..35d686c 100755 --- a/main.c +++ b/main.c @@ -19,7 +19,7 @@ char *version[] = { - "ryudo version 0.1, Copyright (c) 1994-1996 David Hogan, (c) 2004 Russ Cox, (c) 2019 Derek Stevens", 0 + "ryudo version 0.2\nCopyright (c) 1994-1996 David Hogan,\n(c) 2004 Russ Cox,\n(c) 2019-2021 Derek Stevens", 0 }; Display *dpy; @@ -58,16 +58,7 @@ Atom _rio_hold_mode; Atom wm_state_fullscreen; Atom wm_state; -char *fontlist[] = { - "*-lucidatypewriter-medium-*-12-*-75-*", - "lucm.latin1.9", - "blit", - "*-lucidatypewriter-bold-*-14-*-75-*", - "9x15bold", - "fixed", - "*", - 0 -}; +char *fontlist[] = FONTLIST; void usage(void) diff --git a/menu.c b/menu.c index 395f1e4..ce4c824 100755 --- a/menu.c +++ b/menu.c @@ -16,6 +16,7 @@ #include #include "dat.h" #include "fns.h" +#include "config.h" Client *hiddenc[MAXHIDDEN]; @@ -395,7 +396,12 @@ button2(int n) void switch_to_c(int n, Client *c) { - if(c == 0) +#ifdef AUTOSTICK + static char *autostick[] = AUTOSTICK; + char **a = autostick; +#endif + + if(c == 0) return; if(c->next) @@ -404,6 +410,15 @@ switch_to_c(int n, Client *c) if(c->parent == DefaultRootWindow(dpy)) return; +#ifdef AUTOSTICK + while(*a){ + if (strstr(c->class, *a) && c->virt >= 0) { + stick(c); + } + ++a; + } +#endif + if(c->virt != virt && c->state == NormalState && c->virt >= 0){ XUnmapWindow(dpy, c->parent); XUnmapWindow(dpy, c->window); @@ -423,6 +438,7 @@ switch_to_c(int n, Client *c) setstate(c, NormalState); if(currents[virt] == c) active(c); + } } }