diff options
| -rw-r--r-- | config.h | 124 | ||||
| -rw-r--r-- | drw.o | bin | 0 -> 9068 bytes | |||
| -rwxr-xr-x | dwm | bin | 0 -> 56056 bytes | |||
| -rw-r--r-- | dwm.c | 40 | ||||
| -rw-r--r-- | dwm.o | bin | 0 -> 40780 bytes | |||
| -rw-r--r-- | util.o | bin | 0 -> 1752 bytes |
6 files changed, 124 insertions, 40 deletions
diff --git a/config.h b/config.h new file mode 100644 index 0000000..0a89621 --- /dev/null +++ b/config.h | |||
| @@ -0,0 +1,124 @@ | |||
| 1 | /* See LICENSE file for copyright and license details. */ | ||
| 2 | |||
| 3 | /* appearance */ | ||
| 4 | static const unsigned int borderpx = 1; /* border pixel of windows */ | ||
| 5 | static const unsigned int snap = 32; /* snap pixel */ | ||
| 6 | static const int showbar = 1; /* 0 means no bar */ | ||
| 7 | static const int topbar = 1; /* 0 means bottom bar */ | ||
| 8 | static const char *fonts[] = { "monospace:size=10" }; | ||
| 9 | static const char dmenufont[] = "monospace:size=10"; | ||
| 10 | static const char col_gray1[] = "#222222"; | ||
| 11 | static const char col_gray2[] = "#444444"; | ||
| 12 | static const char col_gray3[] = "#bbbbbb"; | ||
| 13 | static const char col_gray4[] = "#eeeeee"; | ||
| 14 | static const char col_cyan[] = "#005577"; | ||
| 15 | static const char *colors[][3] = { | ||
| 16 | /* fg bg border */ | ||
| 17 | [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, | ||
| 18 | [SchemeSel] = { col_gray4, col_cyan, col_cyan }, | ||
| 19 | }; | ||
| 20 | |||
| 21 | /* tagging */ | ||
| 22 | static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; | ||
| 23 | |||
| 24 | static const Rule rules[] = { | ||
| 25 | /* xprop(1): | ||
| 26 | * WM_CLASS(STRING) = instance, class | ||
| 27 | * WM_NAME(STRING) = title | ||
| 28 | */ | ||
| 29 | /* class instance title tags mask isfloating monitor */ | ||
| 30 | { "Gimp", NULL, NULL, 0, 1, -1 }, | ||
| 31 | { "Firefox", NULL, NULL, 1 << 8, 0, -1 }, | ||
| 32 | }; | ||
| 33 | |||
| 34 | /* layout(s) */ | ||
| 35 | static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ | ||
| 36 | static const int nmaster = 1; /* number of clients in master area */ | ||
| 37 | static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ | ||
| 38 | static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */ | ||
| 39 | static const int refreshrate = 120; /* refresh rate (per second) for client move/resize */ | ||
| 40 | |||
| 41 | static const Layout layouts[] = { | ||
| 42 | /* symbol arrange function */ | ||
| 43 | { "[]=", tile }, /* first entry is default */ | ||
| 44 | { "><>", NULL }, /* no layout function means floating behavior */ | ||
| 45 | { "[M]", monocle }, | ||
| 46 | }; | ||
| 47 | |||
| 48 | /* key definitions */ | ||
| 49 | |||
| 50 | /* | ||
| 51 | * xmodmap: up to 4 keys per modifier, (keycodes in parentheses): | ||
| 52 | * | ||
| 53 | * shift Shift_L (0x32), Shift_R (0x3e) | ||
| 54 | * lock Caps_Lock (0x42) | ||
| 55 | * control Control_L (0x25), Control_R (0x69) | ||
| 56 | * mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L (0xcd) | ||
| 57 | * mod2 Num_Lock (0x4d) | ||
| 58 | * mod3 | ||
| 59 | * mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf) | ||
| 60 | * mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb) | ||
| 61 | */ | ||
| 62 | |||
| 63 | #define MODKEY Mod1Mask | ||
| 64 | #define TAGKEYS(KEY,TAG) \ | ||
| 65 | { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ | ||
| 66 | { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ | ||
| 67 | { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ | ||
| 68 | { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, | ||
| 69 | |||
| 70 | /* commands */ | ||
| 71 | static char dmenumon[8]; /* component of dmenucmd, manipulated in spawn() */ | ||
| 72 | static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL }; | ||
| 73 | static const char *termcmd[] = { "st", NULL }; | ||
| 74 | |||
| 75 | static const Key keys[] = { | ||
| 76 | /* modifier key function argument */ | ||
| 77 | { MODKEY, XK_p, spawn, {.v = dmenucmd } }, | ||
| 78 | { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, | ||
| 79 | { MODKEY, XK_b, togglebar, {0} }, | ||
| 80 | { MODKEY, XK_j, focusstack, {.i = +1 } }, | ||
| 81 | { MODKEY, XK_k, focusstack, {.i = -1 } }, | ||
| 82 | { MODKEY, XK_i, incnmaster, {.i = +1 } }, | ||
| 83 | { MODKEY, XK_d, incnmaster, {.i = -1 } }, | ||
| 84 | { MODKEY, XK_h, setmfact, {.f = -0.05} }, | ||
| 85 | { MODKEY, XK_l, setmfact, {.f = +0.05} }, | ||
| 86 | { MODKEY, XK_Return, zoom, {0} }, | ||
| 87 | { MODKEY, XK_Tab, view, {0} }, | ||
| 88 | { MODKEY|ShiftMask, XK_c, killclient, {0} }, | ||
| 89 | { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, | ||
| 90 | { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, | ||
| 91 | { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, | ||
| 92 | { MODKEY, XK_space, setlayout, {0} }, | ||
| 93 | { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, | ||
| 94 | { MODKEY, XK_0, view, {.ui = ~0 } }, | ||
| 95 | { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, | ||
| 96 | TAGKEYS( XK_1, 0) | ||
| 97 | TAGKEYS( XK_2, 1) | ||
| 98 | TAGKEYS( XK_3, 2) | ||
| 99 | TAGKEYS( XK_4, 3) | ||
| 100 | TAGKEYS( XK_5, 4) | ||
| 101 | TAGKEYS( XK_6, 5) | ||
| 102 | TAGKEYS( XK_7, 6) | ||
| 103 | TAGKEYS( XK_8, 7) | ||
| 104 | TAGKEYS( XK_9, 8) | ||
| 105 | { MODKEY|ShiftMask|ControlMask, XK_e, quit, {0} }, | ||
| 106 | }; | ||
| 107 | |||
| 108 | /* button definitions */ | ||
| 109 | /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ | ||
| 110 | static const Button buttons[] = { | ||
| 111 | /* click event mask button function argument */ | ||
| 112 | { ClkLtSymbol, 0, Button1, setlayout, {0} }, | ||
| 113 | { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, | ||
| 114 | { ClkWinTitle, 0, Button2, zoom, {0} }, | ||
| 115 | { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, | ||
| 116 | { ClkClientWin, MODKEY, Button1, movemouse, {0} }, | ||
| 117 | { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, | ||
| 118 | { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, | ||
| 119 | { ClkTagBar, 0, Button1, view, {0} }, | ||
| 120 | { ClkTagBar, 0, Button3, toggleview, {0} }, | ||
| 121 | { ClkTagBar, MODKEY, Button1, tag, {0} }, | ||
| 122 | { ClkTagBar, MODKEY, Button3, toggletag, {0} }, | ||
| 123 | }; | ||
| 124 | |||
| Binary files differ | |||
| Binary files differ | |||
| @@ -159,14 +159,12 @@ static Monitor *createmon(void); | |||
| 159 | static void destroynotify(XEvent *e); | 159 | static void destroynotify(XEvent *e); |
| 160 | static void detach(Client *c); | 160 | static void detach(Client *c); |
| 161 | static void detachstack(Client *c); | 161 | static void detachstack(Client *c); |
| 162 | static Monitor *dirtomon(int dir); | ||
| 163 | static void drawbar(Monitor *m); | 162 | static void drawbar(Monitor *m); |
| 164 | static void drawbars(void); | 163 | static void drawbars(void); |
| 165 | static void enternotify(XEvent *e); | 164 | static void enternotify(XEvent *e); |
| 166 | static void expose(XEvent *e); | 165 | static void expose(XEvent *e); |
| 167 | static void focus(Client *c); | 166 | static void focus(Client *c); |
| 168 | static void focusin(XEvent *e); | 167 | static void focusin(XEvent *e); |
| 169 | static void focusmon(const Arg *arg); | ||
| 170 | static void focusstack(const Arg *arg); | 168 | static void focusstack(const Arg *arg); |
| 171 | static Atom getatomprop(Client *c, Atom prop); | 169 | static Atom getatomprop(Client *c, Atom prop); |
| 172 | static int getrootptr(int *x, int *y); | 170 | static int getrootptr(int *x, int *y); |
| @@ -206,7 +204,6 @@ static void seturgent(Client *c, int urg); | |||
| 206 | static void showhide(Client *c); | 204 | static void showhide(Client *c); |
| 207 | static void spawn(const Arg *arg); | 205 | static void spawn(const Arg *arg); |
| 208 | static void tag(const Arg *arg); | 206 | static void tag(const Arg *arg); |
| 209 | static void tagmon(const Arg *arg); | ||
| 210 | static void tile(Monitor *m); | 207 | static void tile(Monitor *m); |
| 211 | static void togglebar(const Arg *arg); | 208 | static void togglebar(const Arg *arg); |
| 212 | static void togglefloating(const Arg *arg); | 209 | static void togglefloating(const Arg *arg); |
| @@ -684,21 +681,6 @@ detachstack(Client *c) | |||
| 684 | } | 681 | } |
| 685 | } | 682 | } |
| 686 | 683 | ||
| 687 | Monitor * | ||
| 688 | dirtomon(int dir) | ||
| 689 | { | ||
| 690 | Monitor *m = NULL; | ||
| 691 | |||
| 692 | if (dir > 0) { | ||
| 693 | if (!(m = selmon->next)) | ||
| 694 | m = mons; | ||
| 695 | } else if (selmon == mons) | ||
| 696 | for (m = mons; m->next; m = m->next); | ||
| 697 | else | ||
| 698 | for (m = mons; m->next != selmon; m = m->next); | ||
| 699 | return m; | ||
| 700 | } | ||
| 701 | |||
| 702 | void | 684 | void |
| 703 | drawbar(Monitor *m) | 685 | drawbar(Monitor *m) |
| 704 | { | 686 | { |
| @@ -826,20 +808,6 @@ focusin(XEvent *e) | |||
| 826 | } | 808 | } |
| 827 | 809 | ||
| 828 | void | 810 | void |
| 829 | focusmon(const Arg *arg) | ||
| 830 | { | ||
| 831 | Monitor *m; | ||
| 832 | |||
| 833 | if (!mons->next) | ||
| 834 | return; | ||
| 835 | if ((m = dirtomon(arg->i)) == selmon) | ||
| 836 | return; | ||
| 837 | unfocus(selmon->sel, 0); | ||
| 838 | selmon = m; | ||
| 839 | focus(NULL); | ||
| 840 | } | ||
| 841 | |||
| 842 | void | ||
| 843 | focusstack(const Arg *arg) | 811 | focusstack(const Arg *arg) |
| 844 | { | 812 | { |
| 845 | Client *c = NULL, *i; | 813 | Client *c = NULL, *i; |
| @@ -1690,14 +1658,6 @@ tag(const Arg *arg) | |||
| 1690 | } | 1658 | } |
| 1691 | 1659 | ||
| 1692 | void | 1660 | void |
| 1693 | tagmon(const Arg *arg) | ||
| 1694 | { | ||
| 1695 | if (!selmon->sel || !mons->next) | ||
| 1696 | return; | ||
| 1697 | sendmon(selmon->sel, dirtomon(arg->i)); | ||
| 1698 | } | ||
| 1699 | |||
| 1700 | void | ||
| 1701 | tile(Monitor *m) | 1661 | tile(Monitor *m) |
| 1702 | { | 1662 | { |
| 1703 | unsigned int i, n, h, mw, my, ty; | 1663 | unsigned int i, n, h, mw, my, ty; |
| Binary files differ | |||
| Binary files differ | |||
