comparison config.h @ 6:0968b3739b8d

apply keymodes patch
author paulo@thepaulopc
date Sun, 12 Jun 2011 14:32:54 -0700
parents a54de16f8277
children 162accc5d36d
comparison
equal deleted inserted replaced
3:0956b0011b84 4:5f0cd6e7e393
44 /* first entry is default */ \ 44 /* first entry is default */ \
45 }; 45 };
46 #define MASTER 650 /* per thousand */ 46 #define MASTER 650 /* per thousand */
47 #define NMASTER 1 /* clients in master area */ 47 #define NMASTER 1 /* clients in master area */
48 48
49 #define COMMANDMODE 1
50 #define INSERTMODE 2
51
49 /* key definitions */ 52 /* key definitions */
50 #define MODKEY Mod4Mask 53 #define MODKEY Mod4Mask
51 #define KEYS \ 54 #define KEYS \
52 static Key key[] = { \ 55 static Key key[] = { \
53 /* modifier key function argument */ \ 56 /* modifier key function argument */ \
54 { MODKEY|ShiftMask, XK_Return, spawn, { .cmd = "/home/paulo/bin/myterm.sh" } }, \ 57 { MODKEY, XK_Escape, setkeymode, { .i = COMMANDMODE } }, \
55 { MODKEY, XK_backslash, spawn, { .cmd = "/home/paulo/bin/myterm.sh -e /home/paulo/bin/viclip.sh" } }, \
56 { MODKEY, XK_n, pushdown, { 0 } }, \
57 { MODKEY, XK_p, pushup, { 0 } }, \
58 { MODKEY, XK_Tab, focusnext, { 0 } }, \
59 { MODKEY|ShiftMask, XK_Tab, focusprev, { 0 } }, \
60 { MODKEY, XK_Return, zoom, { 0 } }, \
61 { MODKEY, XK_g, resizemaster, { .i = 15 } }, \
62 { MODKEY, XK_s, resizemaster, { .i = -15 } }, \
63 { MODKEY, XK_i, incnmaster, { .i = 1 } }, \
64 { MODKEY, XK_d, incnmaster, { .i = -1 } }, \
65 { MODKEY|ShiftMask, XK_grave, tag, { .i = -1 } }, \
66 { MODKEY|ShiftMask, XK_1, tag, { .i = 0 } }, \
67 { MODKEY|ShiftMask, XK_2, tag, { .i = 1 } }, \
68 { MODKEY|ShiftMask, XK_3, tag, { .i = 2 } }, \
69 { MODKEY|ShiftMask, XK_4, tag, { .i = 3 } }, \
70 { MODKEY|ShiftMask, XK_5, tag, { .i = 4 } }, \
71 { MODKEY|ShiftMask, XK_6, tag, { .i = 5 } }, \
72 { MODKEY|ShiftMask, XK_7, tag, { .i = 6 } }, \
73 { MODKEY|ShiftMask, XK_8, tag, { .i = 7 } }, \
74 { MODKEY|ShiftMask, XK_9, tag, { .i = 8 } }, \
75 { MODKEY|ShiftMask, XK_0, tag, { .i = 9 } }, \
76 { MODKEY|ControlMask|ShiftMask, XK_1, toggletag, { .i = 0 } }, \
77 { MODKEY|ControlMask|ShiftMask, XK_2, toggletag, { .i = 1 } }, \
78 { MODKEY|ControlMask|ShiftMask, XK_3, toggletag, { .i = 2 } }, \
79 { MODKEY|ControlMask|ShiftMask, XK_4, toggletag, { .i = 3 } }, \
80 { MODKEY|ControlMask|ShiftMask, XK_5, toggletag, { .i = 4 } }, \
81 { MODKEY|ControlMask|ShiftMask, XK_6, toggletag, { .i = 5 } }, \
82 { MODKEY|ControlMask|ShiftMask, XK_7, toggletag, { .i = 6 } }, \
83 { MODKEY|ControlMask|ShiftMask, XK_8, toggletag, { .i = 7 } }, \
84 { MODKEY|ControlMask|ShiftMask, XK_9, toggletag, { .i = 8 } }, \
85 { MODKEY|ControlMask|ShiftMask, XK_0, toggletag, { .i = 9 } }, \
86 { MODKEY|ShiftMask, XK_c, killclient, { 0 } }, \
87 { MODKEY, XK_space, setlayout, { .i = -1 } }, \
88 { MODKEY|ShiftMask, XK_space, setlayout, { .i = -2 } }, \
89 { MODKEY, XK_F1, setlayout, { .i = 0 } }, \
90 { MODKEY, XK_F2, setlayout, { .i = 1 } }, \
91 { MODKEY, XK_F3, setlayout, { .i = 2 } }, \
92 { MODKEY, XK_F4, setlayout, { .i = 3 } }, \
93 { MODKEY, XK_F5, setlayout, { .i = 4 } }, \
94 { MODKEY, XK_F6, setlayout, { .i = 5 } }, \
95 { MODKEY, XK_F7, setlayout, { .i = 6 } }, \
96 { MODKEY|ControlMask, XK_space, toggleversatile,{ 0 } }, \
97 { MODKEY, XK_grave, view, { .i = -1 } }, \
98 { MODKEY, XK_1, view, { .i = 0 } }, \
99 { MODKEY, XK_2, view, { .i = 1 } }, \
100 { MODKEY, XK_3, view, { .i = 2 } }, \
101 { MODKEY, XK_4, view, { .i = 3 } }, \
102 { MODKEY, XK_5, view, { .i = 4 } }, \
103 { MODKEY, XK_6, view, { .i = 5 } }, \
104 { MODKEY, XK_7, view, { .i = 6 } }, \
105 { MODKEY, XK_8, view, { .i = 7 } }, \
106 { MODKEY, XK_9, view, { .i = 8 } }, \
107 { MODKEY, XK_0, view, { .i = 9 } }, \
108 { MODKEY, XK_minus, next_view, { .i = -1 } }, \
109 { MODKEY, XK_equal, next_view, { .i = 1 } }, \
110 { MODKEY, XK_BackSpace, last_view, { 0 } }, \
111 { MODKEY|ControlMask, XK_1, toggleview, { .i = 0 } }, \
112 { MODKEY|ControlMask, XK_2, toggleview, { .i = 1 } }, \
113 { MODKEY|ControlMask, XK_3, toggleview, { .i = 2 } }, \
114 { MODKEY|ControlMask, XK_4, toggleview, { .i = 3 } }, \
115 { MODKEY|ControlMask, XK_5, toggleview, { .i = 4 } }, \
116 { MODKEY|ControlMask, XK_6, toggleview, { .i = 5 } }, \
117 { MODKEY|ControlMask, XK_7, toggleview, { .i = 6 } }, \
118 { MODKEY|ControlMask, XK_8, toggleview, { .i = 7 } }, \
119 { MODKEY|ControlMask, XK_9, toggleview, { .i = 8 } }, \
120 { MODKEY|ControlMask, XK_0, toggleview, { .i = 9 } }, \
121 { MODKEY|ShiftMask, XK_q, quit, { 0 } }, \
122 { MODKEY, XK_h, moveresize, "-25x 0y 0w 0h" }, \ 58 { MODKEY, XK_h, moveresize, "-25x 0y 0w 0h" }, \
123 { MODKEY, XK_l, moveresize, "25x 0y 0w 0h" }, \ 59 { MODKEY, XK_l, moveresize, "25x 0y 0w 0h" }, \
124 { MODKEY, XK_j, moveresize, "0x 25y 0w 0h" }, \ 60 { MODKEY, XK_j, moveresize, "0x 25y 0w 0h" }, \
125 { MODKEY, XK_k, moveresize, "0x -25y 0w 0h" }, \ 61 { MODKEY, XK_k, moveresize, "0x -25y 0w 0h" }, \
126 { MODKEY|ControlMask, XK_h, moveresize, "0X 0y 0w 0h" }, \ 62 { MODKEY|ControlMask, XK_h, moveresize, "0X 0y 0w 0h" }, \
132 { MODKEY|ShiftMask, XK_j, moveresize, "0x 0y 0w 25h" }, \ 68 { MODKEY|ShiftMask, XK_j, moveresize, "0x 0y 0w 25h" }, \
133 { MODKEY|ShiftMask, XK_k, moveresize, "0x 0y 0w -25h" }, \ 69 { MODKEY|ShiftMask, XK_k, moveresize, "0x 0y 0w -25h" }, \
134 }; 70 };
135 71
136 #define MAX_TASKS 13 /* max number of apps in taskbar */ 72 #define MAX_TASKS 13 /* max number of apps in taskbar */
73
74 #define CMDKEYS \
75 static Key cmdkeys[] = { \
76 /* modifier keys function argument */ \
77 { 0, XK_Escape, clearcmd, { 0 } }, \
78 { ControlMask, XK_c, clearcmd, { 0 } }, \
79 { MODKEY|ShiftMask, XK_x, killclient, { 0 } }, \
80 { MODKEY|ShiftMask, XK_q, quit, { 0 } }, \
81 { 0, XK_i, setkeymode, { .i = INSERTMODE } }, \
82 { 0, XK_o, spawn, { .cmd = "/home/paulo/bin/myterm.sh" } }, \
83 { ShiftMask, XK_o, spawn_insert, { .cmd = "/home/paulo/bin/myterm.sh" } }, \
84 { 0, XK_backslash, spawn, { .cmd = "/home/paulo/bin/myterm.sh -e /home/paulo/bin/viclip.sh" } }, \
85 { ShiftMask, XK_backslash, spawn_insert, { .cmd = "/home/paulo/bin/myterm.sh -e /home/paulo/bin/viclip.sh" } }, \
86 { 0, XK_n, pushdown, { 0 } }, \
87 { ShiftMask, XK_n, pushup, { 0 } }, \
88 { 0, XK_j, focusnext, { 0 } }, \
89 { 0, XK_k, focusprev, { 0 } }, \
90 { 0, XK_Return, zoom, { 0 } }, \
91 { ShiftMask, XK_Return, zoom_insert, { 0 } }, \
92 { 0, XK_m, resizemaster, { .i = 15 } }, \
93 { ShiftMask, XK_m, resizemaster, { .i = -15 } }, \
94 { 0, XK_d, incnmaster, { .i = 1 } }, \
95 { ShiftMask, XK_d, incnmaster, { .i = -1 } }, \
96 { 0, XK_v, next_view, { .i = 1 } }, \
97 { ShiftMask, XK_v, next_view, { .i = -1 } }, \
98 { 0, XK_BackSpace, last_view, { 0 } }, \
99 { 0, XK_l, setlayout, { .i = -1 } }, \
100 { ShiftMask, XK_l, setlayout, { .i = -2 } }, \
101 };
102
103 #define COMMANDS \
104 static Command commands[] = { \
105 /* modifier (4 keys) keysyms (4 keys) function argument */ \
106 { {0, 0, 0, 0}, {XK_grave, XK_v, 0, 0}, view, { .i = -1 } }, \
107 { {0, 0, 0, 0}, {XK_1, XK_v, 0, 0}, view, { .i = 0 } }, \
108 { {0, 0, 0, 0}, {XK_2, XK_v, 0, 0}, view, { .i = 1 } }, \
109 { {0, 0, 0, 0}, {XK_3, XK_v, 0, 0}, view, { .i = 2 } }, \
110 { {0, 0, 0, 0}, {XK_4, XK_v, 0, 0}, view, { .i = 3 } }, \
111 { {0, 0, 0, 0}, {XK_5, XK_v, 0, 0}, view, { .i = 4 } }, \
112 { {0, 0, 0, 0}, {XK_6, XK_v, 0, 0}, view, { .i = 5 } }, \
113 { {0, 0, 0, 0}, {XK_7, XK_v, 0, 0}, view, { .i = 6 } }, \
114 { {0, 0, 0, 0}, {XK_8, XK_v, 0, 0}, view, { .i = 7 } }, \
115 { {0, 0, 0, 0}, {XK_9, XK_v, 0, 0}, view, { .i = 8 } }, \
116 { {0, 0, 0, 0}, {XK_0, XK_v, 0, 0}, view, { .i = 9 } }, \
117 { {0, ShiftMask, 0, 0}, {XK_grave, XK_v, 0, 0}, toggleversatile, { 0 } }, \
118 { {0, ShiftMask, 0, 0}, {XK_1, XK_v, 0, 0}, toggleview, { .i = 0 } }, \
119 { {0, ShiftMask, 0, 0}, {XK_2, XK_v, 0, 0}, toggleview, { .i = 1 } }, \
120 { {0, ShiftMask, 0, 0}, {XK_3, XK_v, 0, 0}, toggleview, { .i = 2 } }, \
121 { {0, ShiftMask, 0, 0}, {XK_4, XK_v, 0, 0}, toggleview, { .i = 3 } }, \
122 { {0, ShiftMask, 0, 0}, {XK_5, XK_v, 0, 0}, toggleview, { .i = 4 } }, \
123 { {0, ShiftMask, 0, 0}, {XK_6, XK_v, 0, 0}, toggleview, { .i = 5 } }, \
124 { {0, ShiftMask, 0, 0}, {XK_7, XK_v, 0, 0}, toggleview, { .i = 6 } }, \
125 { {0, ShiftMask, 0, 0}, {XK_8, XK_v, 0, 0}, toggleview, { .i = 7 } }, \
126 { {0, ShiftMask, 0, 0}, {XK_9, XK_v, 0, 0}, toggleview, { .i = 8 } }, \
127 { {0, ShiftMask, 0, 0}, {XK_0, XK_v, 0, 0}, toggleview, { .i = 9 } }, \
128 { {0, 0, 0, 0}, {XK_1, XK_l, 0, 0}, setlayout, { .i = 0 } }, \
129 { {0, 0, 0, 0}, {XK_2, XK_l, 0, 0}, setlayout, { .i = 1 } }, \
130 { {0, 0, 0, 0}, {XK_3, XK_l, 0, 0}, setlayout, { .i = 2 } }, \
131 { {0, 0, 0, 0}, {XK_4, XK_l, 0, 0}, setlayout, { .i = 3 } }, \
132 { {0, 0, 0, 0}, {XK_5, XK_l, 0, 0}, setlayout, { .i = 4 } }, \
133 { {0, 0, 0, 0}, {XK_6, XK_l, 0, 0}, setlayout, { .i = 5 } }, \
134 { {0, 0, 0, 0}, {XK_7, XK_l, 0, 0}, setlayout, { .i = 6 } }, \
135 { {0, 0, 0, 0}, {XK_grave, XK_t, 0, 0}, tag, { .i = -1 } }, \
136 { {0, 0, 0, 0}, {XK_1, XK_t, 0, 0}, tag, { .i = 0 } }, \
137 { {0, 0, 0, 0}, {XK_2, XK_t, 0, 0}, tag, { .i = 1 } }, \
138 { {0, 0, 0, 0}, {XK_3, XK_t, 0, 0}, tag, { .i = 2 } }, \
139 { {0, 0, 0, 0}, {XK_4, XK_t, 0, 0}, tag, { .i = 3 } }, \
140 { {0, 0, 0, 0}, {XK_5, XK_t, 0, 0}, tag, { .i = 4 } }, \
141 { {0, 0, 0, 0}, {XK_6, XK_t, 0, 0}, tag, { .i = 5 } }, \
142 { {0, 0, 0, 0}, {XK_7, XK_t, 0, 0}, tag, { .i = 6 } }, \
143 { {0, 0, 0, 0}, {XK_8, XK_t, 0, 0}, tag, { .i = 7 } }, \
144 { {0, 0, 0, 0}, {XK_9, XK_t, 0, 0}, tag, { .i = 8 } }, \
145 { {0, 0, 0, 0}, {XK_0, XK_t, 0, 0}, tag, { .i = 9 } }, \
146 { {0, ShiftMask, 0, 0}, {XK_1, XK_t, 0, 0}, toggletag, { .i = 0 } }, \
147 { {0, ShiftMask, 0, 0}, {XK_2, XK_t, 0, 0}, toggletag, { .i = 1 } }, \
148 { {0, ShiftMask, 0, 0}, {XK_3, XK_t, 0, 0}, toggletag, { .i = 2 } }, \
149 { {0, ShiftMask, 0, 0}, {XK_4, XK_t, 0, 0}, toggletag, { .i = 3 } }, \
150 { {0, ShiftMask, 0, 0}, {XK_5, XK_t, 0, 0}, toggletag, { .i = 4 } }, \
151 { {0, ShiftMask, 0, 0}, {XK_6, XK_t, 0, 0}, toggletag, { .i = 5 } }, \
152 { {0, ShiftMask, 0, 0}, {XK_7, XK_t, 0, 0}, toggletag, { .i = 6 } }, \
153 { {0, ShiftMask, 0, 0}, {XK_8, XK_t, 0, 0}, toggletag, { .i = 7 } }, \
154 { {0, ShiftMask, 0, 0}, {XK_9, XK_t, 0, 0}, toggletag, { .i = 8 } }, \
155 { {0, ShiftMask, 0, 0}, {XK_0, XK_t, 0, 0}, toggletag, { .i = 9 } }, \
156 };