|
http://flash.metawaredesign.co.uk/4/
站点本身就是dwm化的,呵呵
打了补丁后,Alt-Tab即可切回原先的tag,很实用的
http://flash.metawaredesign.co.uk/files/dwm/dwm-3.8-viewlast.diff
- diff -up dwm-3.8/config.default.h dwm-3.8-viewlast/config.default.h
- --- dwm-3.8/config.default.h 2007-03-05 10:54:57.000000000 +0000
- +++ dwm-3.8-viewlast/config.default.h 2007-03-05 19:10:20.000000000 +0000
- @@ -53,6 +53,7 @@ static Key key[] = { \
- { MODKEY, XK_k, focusclient, "-1" }, \
- { MODKEY, XK_m, togglemax, NULL }, \
- { MODKEY, XK_Return, zoom, NULL }, \
- + { MODKEY, XK_Tab, viewlast, NULL }, \
- { MODKEY|ShiftMask, XK_space, togglefloating, NULL }, \
- { MODKEY|ShiftMask, XK_c, killclient, NULL }, \
- { MODKEY, XK_0, view, NULL }, \
- diff -up dwm-3.8/dwm.h dwm-3.8-viewlast/dwm.h
- --- dwm-3.8/dwm.h 2007-03-05 10:54:57.000000000 +0000
- +++ dwm-3.8-viewlast/dwm.h 2007-03-05 19:10:20.000000000 +0000
- @@ -87,6 +87,7 @@ unsigned int ntags, numlockmask; /* numb
- void (*handler[LASTEvent])(XEvent *); /* event handler */
- Atom wmatom[WMLast], netatom[NetLast];
- Bool selscreen, *seltag; /* seltag is array of Bool */
- +unsigned int currenttag, lasttag; /* The last tag viewed */
- Client *clients, *sel, *stack; /* global client list and stack */
- Cursor cursor[CurLast];
- DC dc; /* global draw context */
- @@ -139,6 +140,7 @@ void settags(Client *c, Client *trans);
- void tag(const char *arg); /* tags c with arg's index */
- void toggletag(const char *arg); /* toggles c tags with arg's index */
- void toggleview(const char *arg); /* toggles the tag with arg's index (in)visible */
- +void viewlast(void); /* views the last viewed tag */
- void view(const char *arg); /* views the tag with arg's index */
-
- /* util.c */
- diff -up dwm-3.8/main.c dwm-3.8-viewlast/main.c
- --- dwm-3.8/main.c 2007-03-05 10:54:57.000000000 +0000
- +++ dwm-3.8-viewlast/main.c 2007-03-05 19:10:20.000000000 +0000
- @@ -20,6 +20,7 @@
- char stext[256];
- int screen, sx, sy, sw, sh, wax, way, waw, wah;
- unsigned int bh, ntags, numlockmask;
- +unsigned int currenttag, lasttag;
- Atom wmatom[WMLast], netatom[NetLast];
- Bool *seltag;
- Bool selscreen = True;
- @@ -185,6 +186,8 @@ setup(void) {
- sw = DisplayWidth(dpy, screen);
- sh = DisplayHeight(dpy, screen);
- initlayouts();
- + currenttag = 0;
- + lasttag = 0;
- /* bar */
- dc.h = bh = dc.font.height + 2;
- wa.override_redirect = 1;
- diff -up dwm-3.8/tag.c dwm-3.8-viewlast/tag.c
- --- dwm-3.8/tag.c 2007-03-05 10:54:57.000000000 +0000
- +++ dwm-3.8-viewlast/tag.c 2007-03-05 19:11:32.000000000 +0000
- @@ -142,13 +142,27 @@ toggleview(const char *arg) {
- }
-
- void
- +viewlast(void) {
- + char buf[32];
- + snprintf(buf, sizeof buf, "%d", lasttag);
- + view(buf);
- + lt->arrange();
- +}
- +
- +void
- view(const char *arg) {
- int i;
-
- for(i = 0; i < ntags; i++)
- seltag[i] = arg == NULL;
- i = arg ? atoi(arg) : 0;
- - if(i >= 0 && i < ntags)
- + if(i >= 0 && i < ntags) {
- seltag[i] = True;
- +
- + if (currenttag != i) {
- + lasttag = currenttag;
- + currenttag = i;
- + }
- + }
- lt->arrange();
- }
复制代码 |
|